2023-07-21 02:07:23 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-03-08 19:11:04 +00:00
|
|
|
FILE="$HOME/.local/state/idle_mode"
|
2024-08-16 17:09:00 +00:00
|
|
|
if [[ -e $FILE ]]; then
|
|
|
|
MODE=$(cat $FILE)
|
2023-07-21 02:07:23 +00:00
|
|
|
else
|
2024-08-16 17:09:00 +00:00
|
|
|
MODE="fade"
|
2023-07-21 02:07:23 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $MODE == "none" ]]; then
|
2023-08-14 04:27:34 +00:00
|
|
|
ICON="☕"
|
2023-07-21 02:07:23 +00:00
|
|
|
elif [[ $MODE == "fade" ]]; then
|
2023-08-14 04:27:34 +00:00
|
|
|
ICON="🌌"
|
2023-07-21 02:07:23 +00:00
|
|
|
elif [[ $MODE == "dim" ]]; then
|
2023-08-14 04:27:34 +00:00
|
|
|
ICON="⬛"
|
2023-07-21 02:07:23 +00:00
|
|
|
elif [[ $MODE == "lock" ]]; then
|
2023-08-14 04:27:34 +00:00
|
|
|
ICON="🔒"
|
2023-07-21 02:07:23 +00:00
|
|
|
elif [[ $MODE == "sleep" ]]; then
|
2023-08-14 04:27:34 +00:00
|
|
|
ICON="💤"
|
2023-07-21 02:07:23 +00:00
|
|
|
elif [[ $MODE == "hibernate" ]]; then
|
2023-08-14 04:27:34 +00:00
|
|
|
ICON="↯ "
|
2023-07-21 02:07:23 +00:00
|
|
|
else
|
2024-08-16 17:09:00 +00:00
|
|
|
ICON="? "
|
|
|
|
echo '{"text":"'$ICON'","icon":"'$ICON'","tooltip":"Error: Invalid mode ('$MODE')","class":"'$MODE'"}'
|
2023-08-14 04:27:34 +00:00
|
|
|
exit
|
2023-07-21 02:07:23 +00:00
|
|
|
fi
|
|
|
|
|
2024-08-16 17:09:00 +00:00
|
|
|
echo '{"text":"'$ICON'","icon":"'$ICON'","tooltip":"Change sleep mode ('$MODE')","class":"'$MODE'"}'
|