Skip to content

Instantly share code, notes, and snippets.

@zvictor
Created July 9, 2014 08:26
Show Gist options
  • Save zvictor/193b567c14b5b6a679fe to your computer and use it in GitHub Desktop.
Save zvictor/193b567c14b5b6a679fe to your computer and use it in GitHub Desktop.
#!/bin/bash
sleep 1
DISPLAY=":0.0"
HOME=/home/zvictor/
XAUTHORITY=$HOME/.Xauthority
export DISPLAY XAUTHORITY HOME
usbkbd_ids=`xinput -list | grep "Keyboard" | awk -F'=' '{print $2}' | cut -c 1-2`
usbkbd_layout="dk"
for ID in $usbkbd_ids; do
gsettings set org.gnome.settings-daemon.plugins.keyboard active false
sleep 2
setxkbmap -device "${ID}" -layout "${usbkbd_layout}"
done
@zvictor
Copy link
Author

zvictor commented Jul 9, 2014

Script to be used along the solution pointed by @Sadi on stackoverflow 1 and stackoverflow 2 to make an extra keyboard have a specific and different layout than the laptop's one.

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