Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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