Skip to content

Instantly share code, notes, and snippets.

@Tarrasch
Last active December 3, 2021 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tarrasch/867228d65fb9ce484f3d68af5441ed96 to your computer and use it in GitHub Desktop.
Save Tarrasch/867228d65fb9ce484f3d68af5441ed96 to your computer and use it in GitHub Desktop.
Something to map shortcuts to unikey_and_colemak.sh
#!/bin/bash -xe
# Usage:
# Step 1: Test that commands work when running manually
#
# example: /home/rouhani/unikey_and_colemak.sh enable_unikey
#
# Step 2:
#
# Map Desktop environment custom shortcuts to these commnads
#
# /home/rouhani/unikey_and_colemak.sh enable_unikey
# /home/rouhani/unikey_and_colemak.sh try_reset
# /home/rouhani/unikey_and_colemak.sh set_ibus_engine_to_eng
# /home/rouhani/unikey_and_colemak.sh replace_ibus_deamon
case $1 in
enable_unikey)
ibus engine Unikey
setxkbmap -variant colemak
;;
try_reset)
xkbcomp /home/rouhani/repos/keyboard-layout-gist/keymap.xkb :0 || xkbcomp /home/rouhani/repos/keyboard-layout-gist/keymap.xkb :1
;;
set_ibus_engine_to_eng)
ibus engine xkb:us:colemak:eng
;;
replace_ibus_deamon)
ibus-daemon --daemonize --replace --xim
;;
*)
echo 'unknown command noooo'
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment