Skip to content

Instantly share code, notes, and snippets.

@kosivantsov
Created December 24, 2020 20: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 kosivantsov/9fa03143827af0bcc851cf82d2c44e05 to your computer and use it in GitHub Desktop.
Save kosivantsov/9fa03143827af0bcc851cf82d2c44e05 to your computer and use it in GitHub Desktop.
Bash script to enable custom xkb layouts stored somewhere in user's $HOME
#!/bin/bash
######################################################
# In order to use custom xkb layout, create a folder
# under your $HOME (.xkb, for instance), and place
# layouts file there (in this script uk and rus
# are layout files, they need to go to .xkb/symbols).
# This directory will be searched by xkbcomp.
# No need to store custom layouts under /usr/share/X11
######################################################
setxkbmap -layout "us,uk,rus" -variant ",twunicode," \
-option "grp:caps_switch,lv3:ralt_switch,grp:shifts_toggle,compose:rctrl,nbsp:level3" \
-print |\
xkbcomp -I"$HOME/.xkb/" - "$DISPLAY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment