petits-scripts-persos/toggle_suspend

9 lines
249 B
Plaintext
Raw Normal View History

2022-02-10 08:05:07 +00:00
#!/bin/sh
if [ -z "$(grep off "/run/user/1000/enable_suspend")" ] ; then
echo off > "$XDG_RUNTIME_DIR/enable_suspend"
notify-send "Sleep mode is now" "off"
else
echo on > "$XDG_RUNTIME_DIR/enable_suspend"
notify-send "Sleep mode is now" "on"
fi