Skip to content

Instantly share code, notes, and snippets.

@giner
Last active October 27, 2024 13:16
Show Gist options
  • Save giner/77f5b0f7c14603ce5e78b6fcebf48162 to your computer and use it in GitHub Desktop.
Save giner/77f5b0f7c14603ce5e78b6fcebf48162 to your computer and use it in GitHub Desktop.
JAPANESE: Make ibus-mozc remember last used mode
# Make ibus-mozc remember the last used mode (e.g. hiragana) and not switch back to Alphabet on restart
# See https://github.com/google/mozc/issues/381
cd $(mktemp -d)
apt source ibus-mozc
cd mozc-*/
patch src/unix/ibus/property_handler.cc << 'EOF'
--- src/unix/ibus/property_handler.cc.orig 2020-10-28 17:21:18.000849932 +0900
+++ src/unix/ibus/property_handler.cc 2020-10-28 17:21:34.172696046 +0900
@@ -80,7 +80,7 @@
// On IBus 1.4.x, IBus expects that an IME should always be turned on and
// IME on/off keys are handled by IBus itself rather than each IME.
#if IBUS_CHECK_VERSION(1, 5, 0)
-const bool kActivatedOnLaunch = false;
+const bool kActivatedOnLaunch = true;
#else
const bool kActivatedOnLaunch = true;
#endif // IBus>=1.5.0
EOF
sudo apt build-dep ibus-mozc
dpkg-buildpackage -us -uc -b
sudo dpkg -i ../ibus-mozc_*.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment