From c203b4c1404a08072ffce1c8eac09f4dfeceecad Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:45:39 +0300 Subject: [PATCH] Add a swaybar indicator for the touchpad status --- .local/bin/print-status | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.local/bin/print-status b/.local/bin/print-status index 91461ab..b843e6e 100755 --- a/.local/bin/print-status +++ b/.local/bin/print-status @@ -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}%