[swayidle] Add config

This commit is contained in:
Tibo De Peuter 2023-11-10 13:50:28 +01:00
parent 4e0b6e9869
commit 553b973bb4
3 changed files with 5 additions and 28 deletions

View file

@ -1,19 +0,0 @@
#!/usr/bin/env bash
# Configuration of swayidle
# Just run the script
# Kill previous instances to avoid clashing
pkill swayidle
swayidle -w \
timeout 600 \
'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
timeout 1200 \
'systemctl suspend' \
before-sleep 'swaymsg "output * dpms on"; swaylock'
# Screen needs to be turned back on or you will get a black screen after waking up again.
# timeout 300 \
# "~/.scripts/wander.sh" \
# resume 'brightnessctl -r' \

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
# Toggle brightness to 'sleep' or 'awake', since brightnessctl does not support
# percentages of current amount.
# Just run the script
current=$( brightnessctl get )
# Doesn't have to be accurate so we can use built-in calculator.
brightnessctl -sq set $(( current / 10 * 3 ))

View file

@ -0,0 +1,5 @@
timeout 60 'brightnessctl -sq set $(( $(brightnessctl get) / 10 * 3 ))' resume 'brightnessctl -qr'
timeout 120 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'
timeout 240 'systemctl suspend'
before-sleep 'swaymsg "output * dpms on"; swaylock'