dotfiles/niri/.config/niri/toggle_caffeine.sh
2025-07-31 21:09:38 -07:00

17 lines
329 B
Bash
Executable file

#!/bin/sh
caffeine_file=$HOME/.cache/idle
if [[ ! -f $caffeine_file ]] then
echo 0 > $caffeine_file
fi
caffeine=$(<$HOME/.cache/idle)
if [[ $caffeine -eq 0 ]] then
echo 1 > $caffeine_file
notify-send 'Caffeine' 'Caffeine Enabled'
else
echo 0 > $caffeine_file
notify-send 'Caffeine' 'Caffeine Disabled'
fi