add touchscreen status to i3pystatus

This commit is contained in:
Franzi 2019-03-29 18:26:34 +01:00
parent f5a411fed4
commit e5eda5a043
Signed by untrusted user: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 19 additions and 0 deletions

View file

@ -71,6 +71,13 @@ status.register("shell",
hints = {"markup": "pango"},
command="/home/kunsi/.config/i3pystatus/rfkill-bt.py",
interval=1)
status.register("shell",
format="{output}",
hints = {"markup": "pango"},
command="/home/kunsi/.config/i3pystatus/touchscreen.sh",
interval=1,
on_leftclick="xinput enable 'ELAN Touchscreen'",
on_rightclick="xinput disable 'ELAN Touchscreen'")
status.register("network",
interface="wlp4s0",

View file

@ -0,0 +1,12 @@
#!/bin/bash
OUT=$(xinput list-props 'ELAN Touchscreen' | 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 '">Touch</span>'