scripts/waybar/waybar-idle.sh

29 lines
655 B
Bash
Raw Normal View History

#!/bin/bash
FILE="$HOME/.local/state/idle_mode"
if [[ -e $FILE ]]; then
MODE=$(cat $FILE)
else
MODE="fade"
fi
if [[ $MODE == "none" ]]; then
ICON="☕"
elif [[ $MODE == "fade" ]]; then
ICON="🌌"
elif [[ $MODE == "dim" ]]; then
ICON="⬛"
elif [[ $MODE == "lock" ]]; then
ICON="🔒"
elif [[ $MODE == "sleep" ]]; then
ICON="💤"
elif [[ $MODE == "hibernate" ]]; then
ICON="↯ "
else
ICON="? "
echo '{"text":"'$ICON'","icon":"'$ICON'","tooltip":"Error: Invalid mode ('$MODE')","class":"'$MODE'"}'
exit
fi
echo '{"text":"'$ICON'","icon":"'$ICON'","tooltip":"Change sleep mode ('$MODE')","class":"'$MODE'"}'