Skip to main content

Sticky Shift with libskk

··2 mins·
Linux Skk
Makoto Morinaga
Author
Makoto Morinaga
A personal notebook for tech notes, coding, and system experiments.
Table of Contents

Implementing Sticky Shift with libskk.

Both ibus-skk and fcitx5-skk utilize libskk, and enabling Sticky Shift is possible by modifying its configuration. This approach applies to both ibus-skk and fcitx5-skk environments.

For those who found this article through search, a detailed explanation may not be necessary, but SKK is one of the Japanese input methods (like ATOK or Google IME). While it primarily runs on Emacs, it can also function as a system-wide input method via AquaSKK on macOS or fcitx5-skk on Linux. Those unfamiliar with SKK may find it useful to search for more information.

Enabling Sticky Shift
#

According to libskk’s README.rules, the configuration files are located in /usr/share/libskk/rules/. However, user-specific configurations can be placed in ~/.config/libskk/rules/.

The default settings will be inherited, while additional configurations for Sticky Shift will be applied in the user directory.

Preparing the Configuration Directory
#

Create the necessary directory with the following command:

Terminal
mkdir -p ~/.config/libskk/rules/StickyShift/keymap

Setting Up metadata.json
#

First, create a metadata.json file in ~/.config/libskk/rules/StickyShift/ to define the profile:

~/.config/libskk/rules/StickyShift/metadata.json
{
    "name": "Sticky Shift",
    "description": "Enable Sticky Shift"
}

The name and description fields help in identification and can be customized as needed.

Configuring the Keymap
#

In libskk, the following commands can be used to start conversion:

  • start-preedit
  • start-preedit-kana
  • start-preedit-no-delete

To prevent automatic new lines when confirming conversions, start-preedit-no-delete is used. This choice, however, is subjective.

These commands should be specified in keymap configuration files (hiragana.json and katakana.json), which should be placed under ~/.config/libskk/rules/StickyShift/keymap.

  • hiragana.json

    ~/.config/libskk/rules/StickyShift/keymap/hiragana.json
    {
        "include": [
            "default/hiragana"
        ],
        "define": {
            "keymap": {
                ";": "start-preedit-no-delete"
            }
        }
    }
  • katakana.json

    ~/.config/libskk/rules/StickyShift/keymap/katakana.json
    {
        "include": [
            "default/katakana"
        ],
        "define": {
            "keymap": {
                ";": "start-preedit-no-delete"
            }
        }
    }

Activating the Profile
#

In the settings window of ibus-skk or fcitx5-skk, StickyShift will appear as an option under the typing method section. Select it, then restart the system to complete the setup.

Conclusion
#

With this configuration, Sticky Shift is enabled in Japanese input methods using libskk (such as ibus-skk or fcitx5-skk). Since SKK can put a strain on the little finger, Sticky Shift helps achieve a more comfortable typing experience.

Related

Setting Up an Incremental Backup System with Borg
··3 mins
Backup Linux Borg
iptables Configuration
··4 mins
Linux Firewall Iptables
Setting Up an OpenVPN Server
··3 mins
Linux Openvpn