i3pystatus: add controls for trackpad

This commit is contained in:
Franzi 2020-08-23 17:24:06 +02:00
parent 92f0fd8395
commit c981797e33
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 19 additions and 0 deletions

View file

@ -87,6 +87,13 @@ status.register("shell",
interval=1,
on_leftclick="xinput enable 'ELAN Touchscreen'",
on_rightclick="xinput disable 'ELAN Touchscreen'")
status.register("shell",
format="{output}",
hints = {"markup": "pango"},
command="/home/kunsi/.config/i3pystatus/trackpad.sh",
interval=1,
on_leftclick="xinput enable 'SynPS/2 Synaptics TouchPad'",
on_rightclick="xinput disable 'SynPS/2 Synaptics TouchPad'")
status.register("network",
interface="wlp4s0",

12
.config/i3pystatus/trackpad.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
OUT=$(xinput list-props 'SynPS/2 Synaptics TouchPad' | awk '/^\tDevice Enabled \([0-9]+\):\t[01]/ {print $NF}')
echo -n '<span color="'
if [ $OUT -eq 0 ]
then
echo -n "#FF9900"
else
echo -n "#00FF00"
fi
echo '">Trackpad</span>'