From c9e9a17b8b083dfa3bd6c12b82a59d4e9f6b57e8 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Mon, 28 Aug 2023 09:14:03 +0530 Subject: bin/caffeine: lock before screen goes out --- .local/bin/caffeine | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to '.local/bin/caffeine') diff --git a/.local/bin/caffeine b/.local/bin/caffeine index 4407544..014ee7d 100755 --- a/.local/bin/caffeine +++ b/.local/bin/caffeine @@ -55,7 +55,7 @@ caf_time() { dep_check "$menu" - printf "1\n3\n5\n10\n15\n30" | "$menu" -p " sleep after " + printf "1m\n3m\n5m\n10m\n15m\n30m" | "$menu" -p " sleep after " } drink() @@ -71,9 +71,10 @@ drink() disp="$(wlr-randr | grep -om1 '^[^ ]*')" swayidle \ - timeout "$(($1 - 5))" "brightnessctl --save; brightnessctl set 10%-" \ + timeout "$(($1 - 10))" "brightnessctl --save; brightnessctl set 10%-" \ resume "brightnessctl --restore" \ - timeout "$1" "wlr-randr --output ${disp} --off; swaylock" \ + timeout "$(($1 - 5))" "swaylock" \ + timeout "$1" "wlr-randr --output ${disp} --off" \ resume "wlr-randr --output ${disp} --on --adaptive-sync enabled" & echo $! > "$cfpid" -- cgit v1.2.3