Created
August 2, 2020 06:19
-
-
Save mhdzli/2195347866adfa9c832d35cccc35016b to your computer and use it in GitHub Desktop.
Toggle touchpad in sway
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TOUCHPAD_ID="$(swaymsg -t get_inputs | grep 'identifier.*Touchpad' | cut -d'"' -f4)" #give me the touchpad identifier | |
STATE="$(swaymsg -t get_inputs | jq .[0].libinput.send_events)" #check if touchpad is enabled | |
[ "$STATE" = '"enabled"' ] && swaymsg input "$TOUCHPAD_ID" events disabled || swaymsg input "$TOUCHPAD_ID" events enabled |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The second line doesn"t work (anymore?). Here a fix:
STATE="$(swaymsg -t get_inputs | jq '.[] | select(.identifier=="'"$TOUCHPAD_ID"'") | .libinput.send_events')" #check if touchpad is enabled