[swayidle] Add config
This commit is contained in:
parent
e55d4b46dd
commit
e24ac8bd16
3 changed files with 5 additions and 28 deletions
|
@ -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' \
|
|
@ -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 ))
|
||||
|
5
stow/swayidle/.config/swayidle/config
Normal file
5
stow/swayidle/.config/swayidle/config
Normal 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'
|
Loading…
Reference in a new issue