diff options
author | Arnold Sommerfeld <sommerfeld@strisemarx.com> | 2023-05-17 18:44:48 +0100 |
---|---|---|
committer | Arnold Sommerfeld <sommerfeld@strisemarx.com> | 2023-10-18 11:16:43 +0100 |
commit | b487984ecc61c6229cf92550030745c192fd3d0b (patch) | |
tree | 937e598c941fc1172467aeeed8ef51cbfceaca62 /home/.local/bin/input-setup | |
download | dotfiles-b487984ecc61c6229cf92550030745c192fd3d0b.tar.gz dotfiles-b487984ecc61c6229cf92550030745c192fd3d0b.tar.bz2 dotfiles-b487984ecc61c6229cf92550030745c192fd3d0b.zip |
first commit
Diffstat (limited to 'home/.local/bin/input-setup')
-rwxr-xr-x | home/.local/bin/input-setup | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/home/.local/bin/input-setup b/home/.local/bin/input-setup new file mode 100755 index 0000000..95f7d31 --- /dev/null +++ b/home/.local/bin/input-setup @@ -0,0 +1,50 @@ +#!/usr/bin/env sh + +[ -r ~/.config/X11/Xkeymap ] && xkbcomp ~/.config/X11/Xkeymap "$DISPLAY" + +setlayout() { + ids=$(xinput --list | sed -ne '/Virtual core keyboard/{:a' -e 'n;p;ba' -e '}' | grep "$1" | sed -n 's/.*id=\([0-9]\+\).*/\1/p') + for i in $ids; do + setxkbmap -device "$i" -layout "$2" + done +} + +setmodmap() { + kbds=$(xinput --list | sed -ne '/Virtual core keyboard/{:a' -e 'n;p;ba' -e '}' | grep "$1" | sed -n 's/.*id=\([0-9]\+\).*/\1/p') + if [ "$kbds" ]; then + xmodmap ~/.config/X11/Xmodmap + fi +} + +if [ "$(uname -n)" = "halley" ]; then + setxkbmap -layout no +elif [ "$(uname -n)" = "hercules" ]; then + setxkbmap -layout es +fi + +setxkbmap -option "caps:escape" +xset r rate 250 30 + +setlayout "Kingston HyperX Alloy FPS Pro Mechanical Gaming Keyboard" us +# setlayout "SONiX USB DEVICE" us + +setlayout "SEMITEK USB-HID Gaming Keyboard" us +# setmodmap "SEMITEK USB-HID Gaming Keyboard" + +setlayout "Dierya DK61 Keyboard" us +# setmodmap "Dierya DK61 Keyboard" + +xmodmap ~/.config/X11/Xmodmap + +if [ "$(uname -n)" = "hercules" ]; then + xinput set-prop "ETPS/2 Elantech Touchpad" "libinput Tapping Enabled" 1 + xinput set-prop "ETPS/2 Elantech Touchpad" "libinput Natural Scrolling Enabled" 1 + ids=$(xinput --list | sed -ne '/Virtual core pointer/{:a' -e 'n;p;ba' -e '}' | grep "Kingsis Peripherals ZOWIE Gaming mouse" | sed -n 's/.*id=\([0-9]\+\).*/\1/p') + for i in $ids; do + xinput --set-prop "$i" 'libinput Accel Profile Enabled' 0, 1 + done +elif [ "$(uname -n)" = "halley" ]; then + xinput set-prop "SynPS/2 Synaptics TouchPad" "libinput Tapping Enabled" 1 + xinput set-prop "SynPS/2 Synaptics TouchPad" "libinput Natural Scrolling Enabled" 1 + xinput set-prop "ELAN Touchscreen" "Device Enabled" 0 +fi |