diff options
| author | 2025-01-31 17:44:37 +0000 | |
|---|---|---|
| committer | 2025-01-31 17:56:10 +0000 | |
| commit | 2e5198b850b41e70d493670fa1f3e068641460f4 (patch) | |
| tree | dc7cb73a5db9dbf924d424e510899cffcb92f861 /home | |
| parent | b9ba548966019ba77cfa7c1d4020cc746a6d1ca3 (diff) | |
| download | dotfiles-2e5198b850b41e70d493670fa1f3e068641460f4.tar.gz dotfiles-2e5198b850b41e70d493670fa1f3e068641460f4.tar.bz2 dotfiles-2e5198b850b41e70d493670fa1f3e068641460f4.zip  | |
[sh] Format input-setup
Diffstat (limited to 'home')
| -rwxr-xr-x | home/.local/bin/input-setup | 34 | 
1 files changed, 18 insertions, 16 deletions
diff --git a/home/.local/bin/input-setup b/home/.local/bin/input-setup index f052388..50228e3 100755 --- a/home/.local/bin/input-setup +++ b/home/.local/bin/input-setup @@ -3,23 +3,25 @@  [ -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 +  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 +  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)" = "halley2" ]; then -    setxkbmap -layout pt +  setxkbmap -layout pt +  xmodmap ~/.config/X11/Xmodmap  elif [ "$(uname -n)" = "hercules" ]; then -    setxkbmap -layout es +  setxkbmap -layout es +  xmodmap ~/.config/X11/Xmodmap  fi  setxkbmap -option "caps:escape" @@ -39,11 +41,11 @@ 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 +  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)" = "halley2" ]; 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 "SynPS/2 Synaptics TouchPad" "libinput Tapping Enabled" 1 +  xinput set-prop "SynPS/2 Synaptics TouchPad" "libinput Natural Scrolling Enabled" 1  fi  | 
