A script to switch my keyboard and WM configuration bépo <-> azerty

This commit is contained in:
gardouille 2014-10-20 15:26:16 +02:00
parent cd75df8ea8
commit 73967a5c65
1 changed files with 26 additions and 0 deletions

26
bepo_azerty.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh
## Petit script qui switch la disposition du clavier de bépo à azerty
## et qui recharge la configuration de herbsluftwm pour obtenir quelque
## chose d'utilisable dans les deux cas.
setxkbmap -print | grep bepo
## Already bepo? -> switch to azerty
if [ $? -eq 0 ]; then
setxkbmap fr oss
# Select the correct config file for herbstluftw
cp ~/.config/herbstluftwm/autostart.azerty ~/.config/herbstluftwm/autostart
else
lsusb|grep -i typematrix
## TypeMatrix's keyboard connected? -> switch to it
if [ $? -eq 0 ]; then
setxkbmap fr bepo
else
setxkbmap fr bepo
fi
# Select the correct config file for herbstluftw
cp ~/.config/herbstluftwm/autostart.bepo ~/.config/herbstluftwm/autostart
fi
## Reload the herbstluftwm config file
herbstclient reload