summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-06-22 00:19:53 +0200
committerJoe <rbo@gmx.us>2024-06-22 00:19:53 +0200
commit6ef9a92a622647b46fb4a5e424f2cac4a68f221d (patch)
tree54da910202c6b60ed45a90fbdc9fc1ad6ab87d22
parentup (diff)
downloaddotfiles-bsd-6ef9a92a622647b46fb4a5e424f2cac4a68f221d.tar.gz
dotfiles-bsd-6ef9a92a622647b46fb4a5e424f2cac4a68f221d.tar.bz2
dotfiles-bsd-6ef9a92a622647b46fb4a5e424f2cac4a68f221d.tar.xz
dotfiles-bsd-6ef9a92a622647b46fb4a5e424f2cac4a68f221d.tar.zst
dotfiles-bsd-6ef9a92a622647b46fb4a5e424f2cac4a68f221d.zip
up
-rwxr-xr-x.local/bin/kb32
1 files changed, 21 insertions, 11 deletions
diff --git a/.local/bin/kb b/.local/bin/kb
index 29ba370..871fe01 100755
--- a/.local/bin/kb
+++ b/.local/bin/kb
@@ -44,16 +44,26 @@
#
# Script to set the internal keyboard correctly
-xset r rate 200 150
-setxkbmap -option
-setxkbmap -layout us -variant intl
-if [ "$(hostname -s)" = "mother" ]; then
- setxkbmap -option ctrl:swapcaps
- setxkbmap -option caps:none
- xmodmap -e 'keycode 9 = Tab'
- xmodmap -e 'keycode 23 = Escape'
- xmodmap -e 'keycode 37 ='
-fi
-notify-send -u low -t 2000 'kb' ' Swapped Esc/Tab'
+[ -z $DISPLAY ] && exit
+
+config_keyboard() {
+ xset r rate 200 150
+ setxkbmap -option
+ setxkbmap -layout us -variant intl
+ if [ "$(hostname -s)" = "motherqwe" ]; then
+ setxkbmap -option ctrl:swapcaps
+ setxkbmap -option caps:none
+ xmodmap -e 'keycode 9 = Tab'
+ xmodmap -e 'keycode 23 = Escape'
+ xmodmap -e 'keycode 37 ='
+ fi
+ notify-send -u low -t 2000 'kb' ' Swapped Esc/Tab'
+}
+
+config_keyboard
+
+inotifywait -m /dev/input -e create | while read -r a; do
+ config_keyboard
+done
# vim: filetype=sh