petits-scripts-persos/toggle_suspend
2022-03-11 13:43:31 +01:00

9 lines
251 B
Bash
Executable File

#!/bin/sh
if [ -z "$(grep off "$XDG_RUNTIME_DIR/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