#!/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'"}'