From aa9b0a14a9732ac7c33f2f6ff540b4bd1980ea76 Mon Sep 17 00:00:00 2001 From: tiyn Date: Mon, 3 Mar 2025 04:32:35 +0100 Subject: [PATCH] sxhkd: added touchpad toggling and improved the script --- .config/sxhkd/sxhkdrc | 3 +++ .local/bin/etc/sxhkd/touchpad | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 0e64a14..b1280bd 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -49,6 +49,9 @@ super + Return Print screenshot +super + space + touchpad toggle + super + shift + space dunstctl close-all diff --git a/.local/bin/etc/sxhkd/touchpad b/.local/bin/etc/sxhkd/touchpad index 80646e0..637c2ba 100755 --- a/.local/bin/etc/sxhkd/touchpad +++ b/.local/bin/etc/sxhkd/touchpad @@ -4,13 +4,17 @@ # by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice case "$1" in - toggle) (synclient | grep "TouchpadOff.*1" && synclient TouchpadOff=0)>/dev/null && notify-send "TouchPad reactivated." && exit - synclient TouchpadOff=1 && notify-send "TouchPad deactivated." ;; + on) synclient TouchpadOff=0 && notify-send "TouchPad activated." ;; + off) synclient TouchpadOff=1 && notify-send "TouchPad deactivated." ;; + toggle) (synclient | grep "TouchpadOff.*1") && touchpad on && exit + touchpad off ;; *) cat << EOF touchpad: cli script to enable and disable the touchpad. Allowed options: - toggle Toggle the touchpad on and off + on Turn touchpad on + off Turn touchpad off + toggle Toggle the touchpad on or off all else Print this message EOF