diff options
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/caffeine | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/.local/bin/caffeine b/.local/bin/caffeine index ed4eb81..00babe7 100755 --- a/.local/bin/caffeine +++ b/.local/bin/caffeine @@ -43,7 +43,7 @@ dep_check() set_menu() { if [ -n "$WAYLAND_DISPLAY" ]; then - menu="wmenu" + menu="bemenu" elif [ -n "$DISPLAY" ]; then menu="dmenu" else @@ -63,20 +63,18 @@ drink() { # usage: drink <time in mins> : "${1:?}" - disp= - dep_check swayidle wlr-randr brightnessctl swaylock + dep_check swayidle brightnessctl swaylock [ -s "$cfpid" ] && kill "$(cat "$cfpid")" - disp="$(wlr-randr | grep -om1 '^[^ ]*')" swayidle \ timeout "$(($1 - 10))" "brightnessctl --save; brightnessctl set 10%-" \ resume "brightnessctl --restore" \ timeout "$(($1 - 5))" "swaylock" \ - timeout "$1" "wlr-randr --output ${disp} --off" \ - resume "wlr-randr --output ${disp} --on --adaptive-sync enabled" & + timeout "$1" "swaymsg --type command 'output * dpms off'" \ + resume "swaymsg --type command 'output * dpms on'" & echo $! > "$cfpid" [ "$silent" != true ] && |