Submitted scripts and programs
Forum rules
Your own work only.
-
machinebacon
- Baconator
- Posts: 10253
- Joined: Thu Sep 16, 2010 11:03 am
- Location: Pfälzerwald
-
Contact:
Unread post
by machinebacon » Sun Oct 25, 2015 6:09 am
Nothing big, just a special case situation. Imagine you have a laptop with Japanese keyboard. Whenever a US keyboard is plugged, the layouts won't match. This script will help you fix it quickly (call it from ~/.xinitrc):
Code: Select all
#!/bin/bash
setxkbmap jp & # set JP first
keyb=`lsusb | grep Keyboard`
[ -n "$keyb" ] && setxkbmap us & # set US if USB keyboard found
If you write an udev rule for it, the script can be run whenever the device is plugged in.
..gnutella..
-
simgin
- Meme Fodder
- Posts: 1167
- Joined: Sun Jan 06, 2013 12:07 am
- Location: Bradford-on-Avon, UK
Unread post
by simgin » Sun Oct 25, 2015 8:29 am
^ Scriptmaster Bacon :)
Nice one, thank you.
Someone told me that I am delusional, I almost fell off my unicorn.