Skip to content

Commit

Permalink
adding touchpad keymapping
Browse files Browse the repository at this point in the history
touchpad script is changed so now it unloads `psmouse` and reloads it
back
  • Loading branch information
Muhammad Abdullah Khabir committed May 17, 2023
1 parent 5ebfaef commit 1748586
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
24 changes: 13 additions & 11 deletions etc/.local/bin/touchpad
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ In the name of Allah, the most Gracious, the most Merciful.
'
# Toggles touchpad

device_name="$(xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}'\
| grep -Eo '[0-9]{1,2}')"
is_enabled="$(xinput list-props $device_name | grep 'Device Enabled' | \
awk '{print $4}')"
# device_name="$(xinput list | grep -Eio '(touchpad|glidepoint)\s*id\=[0-9]{1,2}'\
# | grep -Eo '[0-9]{1,2}')"
# is_enabled="$(xinput list-props $device_name | grep 'Device Enabled' | \
# awk '{print $4}')"

if [ ${is_enabled} -eq 1 ]; then
xinput disable $device_name
notify-send -u critical -t 1200 'Touchpad disabled'
else
xinput enable $device_name
notify-send 'Touchpad enabled'
fi
# if [ ${is_enabled} -eq 1 ]; then
# xinput disable $device_name
# notify-send -u critical -t 1200 'Touchpad disabled'
# else
# xinput enable $device_name
# notify-send 'Touchpad enabled'
# fi

doas modprobe -r psmouse && doas modprobe psmouse
4 changes: 2 additions & 2 deletions sxhkd/.config/sxhkd/sxhkdrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ alt + shift + {q,r}
bspc {quit,wm -r}

# Toggle touchpad
#alt + e
# "$HOME/.local/bin/touchpad"
alt + e
"$HOME/.local/bin/touchpad"

# alternate between the tiled and monocle layout

Expand Down

0 comments on commit 1748586

Please sign in to comment.