Add auxmenu command for toggle-disable-while-typing

Signed-off-by: magic_rb <magic_rb@redalder.org>
This commit is contained in:
magic_rb 2023-11-03 20:13:12 +01:00
parent c54d257319
commit 434da7529a
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -1,6 +1,6 @@
export SUDO_ASKPASS=/home/main/.xmonad/runenv/libexec/x11-ssh-askpass 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')" _option="$(echo -e $_options | emacs-rofi "command: " 90 30 | awk '{print $1}' | tr -d '\r\n')"
if [ ''${#_option} -gt 0 ] if [ ''${#_option} -gt 0 ]
@ -53,6 +53,16 @@ then
nmtui) nmtui)
alacritty -e 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 esac