summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-08-28 09:14:03 +0530
committersinanmohd <sinan@firemail.cc>2023-08-28 09:14:03 +0530
commitc9e9a17b8b083dfa3bd6c12b82a59d4e9f6b57e8 (patch)
tree52dbe2bfae5db2b3e8ade6a462e20bf9fd0999ff
parent55200a631d33a833998685c9f9723450a873e7ec (diff)
bin/caffeine: lock before screen goes out
-rwxr-xr-x.local/bin/caffeine7
1 files changed, 4 insertions, 3 deletions
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"