Add a swaybar indicator for the touchpad status

This commit is contained in:
Ohad Livne 2025-06-04 22:45:39 +03:00
parent 539fcf48eb
commit c203b4c140
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D

View file

@ -1,5 +1,12 @@
#! /usr/bin/sh
touchpad=$(swaymsg -t get_inputs | jq -r '[.[] | select(.type == "touchpad")][0] | .libinput.send_events')
if [ "${touchpad}" = "enabled" ]; then
touchpad_active="✅"
else
touchpad_active="❎"
fi
today=$(date +'%Y-%m-%d')
now=$(date +'%H:%M:%S')
@ -70,4 +77,4 @@ case "${battery_state}" in
;;
esac
echo 📆${today} ${clock_face}${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%
echo 🕹️${touchpad_active} 📆${today} ${clock_face}${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%