~cyplo/dotfiles

ref: 83ddcc09dc68389b129d598722eca9e90a6dff33 dotfiles/nixos/i3/lock.sh -rwxr-xr-x 432 bytes
83ddcc09 — Cyryl Płotnicki remove broken i3 msg call 1 year, 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash

set -e
set -o pipefail

export PRIMARY_DISPLAY="$(xrandr | awk '/ primary/{print $1}')"

xset s off
xset -dpms

xidlehook \
    --not-when-fullscreen \
    --not-when-audio \
    --timer 60 \
    'xrandr --output "$PRIMARY_DISPLAY" --brightness .1' \
    'xrandr --output "$PRIMARY_DISPLAY" --brightness 1' \
    --timer 600 \
    'xrandr --output "$PRIMARY_DISPLAY" --brightness 1; systemctl suspend' \
    ''