scripts/waybar/waybar-idle.sh

31 lines
612 B
Bash
Executable File

#!/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=" "
fi
MSG="Change sleep mode ($MODE)"
if [[ -z $ICON ]]; then
ICON="🯄 "
MSG="Error: Invalid mode ($MODE)"
fi
echo '{"text":"'$ICON'","icon":"'$ICON'","tooltip":"'$MSG'","class":"'$MODE'"}'