Skip to content

Instantly share code, notes, and snippets.

@ShX
Last active December 30, 2015 03:18
Show Gist options
  • Select an option

  • Save ShX/7768029 to your computer and use it in GitHub Desktop.

Select an option

Save ShX/7768029 to your computer and use it in GitHub Desktop.
Add ''Ukrainian (Macintosh)" layout to Ubuntu
#!/bin/bash
CODE='mac'
NAME='Ukrainian (Macintosh)'
cat >>/usr/share/X11/xkb/symbols/ua <<EOL
partial alphanumeric_keys
xkb_symbols "$CODE" {
include "ua(legacy)"
name[Group1]= "$NAME";
key <AC02> { [ Cyrillic_i, Cyrillic_I ] };
key <AB05> { [ Ukrainian_i, Ukrainian_I ] };
};
EOL
# insert after last 'ua' -> ' homophonic ua: Ukrainian (homophonic)'
echo " $CODE ua: $NAME" >> /usr/share/X11/xkb/rules/xorg.lst
XML="<variant><configItem><name>$CODE</name><description>$NAME</description></configItem></variant>"
echo 'Add '$XML' to /usr/share/X11/xkb/rules/evdev.xml'
read
vim /usr/share/X11/xkb/rules/evdev.xml
sudo rm /var/lib/xkb/*.xkm
echo "reboot system"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment