2>&1

"triggering i3lock on sleep" on https://aligot-death.space, available at https://aligot-death.space/wiki/i3lock-sleep-en

wiki/sysadmin linux

triggering i3lock on sleep

Triggering i3lock when the computer goes to sleep

en fr
Read it aloud: play pause stop

adapted from https://wiki.debian.org/ScreenLockingOnSleep

/etc/systemd/system/i3lock.service:

 1  [Unit]
 2  Description=i3lock
 3  Before=sleep.target
 4 
 5  [Service]
 6  User=nemecle
 7  Type=forking
 8  Environment=DISPLAY=:0
 9  ExecStart=/home/nemecle/.bin/scripts/lock.sh
10 
11  [Install]
12  WantedBy=sleep.target

lock.sh:

1  #!/usr/bin/env bash
2 
3  i3lock -i $HOME/Wallpaper_lock.png