Unix3r

Build. Break. Learn. Repeat.

Starting0%
Skip to content

unix3r/dotfiles

Public
main
U Unix3r Initial commit: sway + waybar dotfiles (Catppuccin Mocha) eb290df
20 lines · 663 B Raw History
1#!/usr/bin/env bash
2# idle.sh — swayidle timeline. Edit the numbers (seconds) to taste.
3LOCK=300 # lock after 5 min
4SCREEN=600 # screens off after 10 min
5SUSPEND=0 # suspend after N seconds (0 = never)
6
7pkill -x swayidle
8
9args=(-w
10 timeout $((LOCK - 15)) 'brightnessctl -s && brightnessctl -q set 30%'
11 resume 'brightnessctl -r'
12 timeout "$LOCK" 'swaylock -f'
13 timeout "$SCREEN" 'swaymsg "output * power off"'
14 resume 'swaymsg "output * power on"'
15 before-sleep 'swaylock -f'
16 after-resume 'swaymsg "output * power on"'
17)
18(( SUSPEND > 0 )) && args+=(timeout "$SUSPEND" 'systemctl suspend')
19
20exec swayidle "${args[@]}"