fix(waybar): Custom scripts

This commit is contained in:
Tibo De Peuter 2025-10-08 09:58:41 +02:00
parent 6005ee646c
commit 411590d12c
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
3 changed files with 20 additions and 9 deletions

View file

@ -19,15 +19,24 @@ while getopts ":g" option; do
if [ "${current_state}" == "${STOPPED_MSG}" ]; then
state='disconnected'
tooltip='Connect tailnet'
printf '{"alt": "%s", "tooltip": "%s", "class": "%s" }' \
"${state}" "${tooltip}" "${state}"
else
state='connected'
tooltip="${status:='Disconnect tailnet'}"
printf '{"alt": "%s", "tooltip": "<tt>%q</tt>", "class": "%s" }' \
"${state}" "${tooltip}" "${state}"
fi
printf '{"alt": "%s", "tooltip": "%q", "class": "%s" }' \
"${state}" "${tooltip}" "${state}"
exit 0
;;
*)
echo 'Invalid option'
exit 1
;;
esac
done