feat(nix): toggle idle
This commit is contained in:
parent
0d378b4f78
commit
675c57ae1b
3 changed files with 30 additions and 20 deletions
11
scripts/ctl
11
scripts/ctl
|
|
@ -412,8 +412,17 @@ power)
|
|||
"$shutdown") systemctl poweroff ;;
|
||||
esac
|
||||
;;
|
||||
idle)
|
||||
require notify-send
|
||||
if pkill hypridle; then
|
||||
notify-send -a ctl -t 2500 'idle off'
|
||||
else
|
||||
hypridle &
|
||||
notify-send -a ctl -t 2500 'idle on'
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ctl {screenshot|ocr|keyboard|audio|wifi|brightness|volume|media|wallpaper|power}" >&2
|
||||
echo "Usage: ctl {screenshot|ocr|keyboard|audio|wifi|brightness|volume|media|wallpaper|power|idle}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue