summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-11-04 19:26:19 +0530
committersinanmohd <sinan@firemail.cc>2023-11-04 19:27:34 +0530
commitb8ab8ca13df82189d4710cb5a36946077d408fe3 (patch)
treebeb18be353139a62d6f6ad5cea594d3f93b00a02 /.local/bin
parent8260316a1d3b9a0bc918988375782c019c1a81be (diff)
wayland: dwl -> sway
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/caffeine10
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 ] &&