Skip to content

Instantly share code, notes, and snippets.

@HikariKnight
Last active July 5, 2020 18:06
Show Gist options
  • Save HikariKnight/8562837d28dec3674dba027c7892e6a5 to your computer and use it in GitHub Desktop.
Save HikariKnight/8562837d28dec3674dba027c7892e6a5 to your computer and use it in GitHub Desktop.
ibus emoji toggle
#!/bin/bash
#### CONFIG
ibus_default_layout="xkb:no::nor"
layout="no"
#### END OF CONFIG

ibus_layout=$(ibus engine)
if [[ "$ibus_layout" == $ibus_default_layout ]]; then
    echo Setting ibus to uniemoji
    ibus engine uniemoji
    setxkbmap $layout
else
    echo Setting ibus back to default
    ibus engine $ibus_default_layout
    setxkbmap $layout
fi

Make sure ibus-daemon --xim --daemonize is running in order to use this script! You also need to have compiled and installed https://github.com/salty-horse/ibus-uniemoji

Change the variables at the top of the script to match your default keyboard layout. you can get the value you need for ibus_default_layout by running ibus list-engine | grep countrycode and pick the one that is correct for your layout

Place the script inside /usr/local/bin and make it executable then make a hotkey to call it.

NOTE: this script was written with tiling window managers in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment