From 434da7529a71a6fdc537627decd4668256750e3e Mon Sep 17 00:00:00 2001 From: magic_rb Date: Fri, 3 Nov 2023 20:13:12 +0100 Subject: [PATCH] Add auxmenu command for `toggle-disable-while-typing` Signed-off-by: magic_rb --- home-manager/modules/xmonad/scripts/auxmenu.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/home-manager/modules/xmonad/scripts/auxmenu.sh b/home-manager/modules/xmonad/scripts/auxmenu.sh index 2d26ae5..edc9487 100644 --- a/home-manager/modules/xmonad/scripts/auxmenu.sh +++ b/home-manager/modules/xmonad/scripts/auxmenu.sh @@ -1,6 +1,6 @@ export SUDO_ASKPASS=/home/main/.xmonad/runenv/libexec/x11-ssh-askpass -_options="toggle-mic\ntoggle-wifi\ntoggle-bluetooth\nscreenshot-all\nscreenshot-select\nscreenshot-focused\nsuspend\nreboot\nkexec\npoweroff\nlogout\nnmtui" +_options="toggle-mic\ntoggle-wifi\ntoggle-bluetooth\nscreenshot-all\nscreenshot-select\nscreenshot-focused\nsuspend\nreboot\nkexec\npoweroff\nlogout\nnmtui\ntoggle-disable-while-typing" _option="$(echo -e $_options | emacs-rofi "command: " 90 30 | awk '{print $1}' | tr -d '\r\n')" if [ ''${#_option} -gt 0 ] @@ -53,6 +53,16 @@ then nmtui) alacritty -e nmtui ;; + toggle-disable-while-typing) + ID=$(xinput list|grep touch -i|sed -nr 's/.*id=([0-9]*).*/\1/p') + IN_TAP=$(xinput list-props $ID|grep "Disable While"|grep -v "Default" |sed -nr 's/.*\(([0-9][0-9][0-9])\).*/\1/p') + CURRENT=$(xinput list-props 12 | grep "Disable While" | grep -v "Default" | sed -nr 's/.*([0-9]+)$/\1/p') + if [ "$CURRENT" == "1" ] ; then + xinput set-prop $ID $IN_TAP 0 + else + xinput set-prop $ID $IN_TAP 1 + fi + ;; *) ;; esac