mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 03:26:13 +01:00
Add auxmenu command for toggle-disable-while-typing
Signed-off-by: magic_rb <magic_rb@redalder.org>
This commit is contained in:
parent
c54d257319
commit
434da7529a
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue