Files
dotfiles/.config/hypr/scripts/toggle-lid-sleep.sh

13 lines
497 B
Bash
Executable File

#!/bin/bash
msgId="3378455"
if pgrep -f "systemd-inhibit --what=handle-lid-switch" > /dev/null; then
pkill -f "systemd-inhibit --what=handle-lid-switch"
# notify-send -u low -r "$msgId" "Lid Sleep" "Do Not Sleep on lid close DISABLED"
else
systemd-inhibit --what=handle-lid-switch --who="Lid Toggle Script" --why="User toggled lid sleep off" --mode=block sleep infinity &
# notify-send -u low -r "$msgId" "Lid Sleep" "Do Not Sleep on lid close ENABLED"
fi
pkill -RTMIN+10 waybar