#!/bin/bash FADE_TIMEOUT=60 # one minute DIM_TIMEOUT=120 # two minutes LOCK_TIMEOUT=300 # five minutes SLEEP_TIMEOUT=600 # ten minutes HIBERNATE_TIMEOUT=3600 # one hour BLFILE="$HOME/.local/state/idle.dim" OPFILE="$HOME/.local/state/active_outputs" IDLEMODE=$(cat $HOME/.local/state/idle_mode) if [[ -n $2 ]]; then if [[ $2 == '--ignore_mode' ]]; then IDLEMODE='hibernate' else echo "Unknown mode $IDLEMODE" exit fi fi if [[ -z $IDLEMODE ]]; then IDLEMODE="lock" fi if [[ $IDLEMODE == 'none' ]]; then IDLEMODE=0 elif [[ $IDLEMODE == 'fade' ]]; then IDLEMODE=1 elif [[ $IDLEMODE == 'dim' ]]; then IDLEMODE=2 elif [[ $IDLEMODE == 'lock' ]]; then IDLEMODE=3 elif [[ $IDLEMODE == 'sleep' ]]; then IDLEMODE=4 elif [[ $IDLEMODE == 'hibernate' ]]; then IDLEMODE=5 else echo "Invalid idle_mode '$IDLEMODE'" fi function usage() { echo "usage: $0