Skip to content

Commit cf417d9

Browse files
committed
Config: Actually lock the screen before going to sleep, using systemd
1 parent c3811b7 commit cf417d9

File tree

5 files changed

+28
-5
lines changed

5 files changed

+28
-5
lines changed

.config/xorg/xinitrc

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ emacs --daemon &
2323
thunar --daemon &
2424

2525
sxhkd "$XDG_CONFIG_HOME/sxhkd/$WM" &
26-
xss-lock -- "$HOME/.local/bin/wm/lock.sh" &
2726

2827
/usr/lib/polkit-kde-authentication-agent-1 &
2928

.local/bin/wm/lock.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ i3lock -n -i "$LOCK" -B 6 -S 1 -e \
5151
--time-size=64 --date-size=24 \
5252
--time-str="%I:%M %p" --date-str="%A, %B %e" \
5353
--time-pos="ix:iy-250" --date-pos="ix:iy-200" \
54-
--time-color=FFFFFFC0 --date-color=FFFFFFC0
54+
--time-color=FFFFFFC0 --date-color=FFFFFFC0 \
55+
--no-modkey-text
5556

5657
revert

README.org

+7-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ $ sudo EDITOR=vim visudo
6565

6666
Add user:
6767
#+BEGIN_SRC shell-script
68-
$ useradd -m -G wheel -s /bin/bash <username>
69-
$ passwd <username>
68+
$ useradd -m -G wheel -s /bin/bash <user>
69+
$ passwd <user>
7070
#+END_SRC
7171

7272
Pacman colors:
@@ -99,6 +99,11 @@ $ git config --global user.email "<email address>"
9999
$ git config --global user.name "<name>"
100100
#+END_SRC
101101

102+
Lock before sleep:
103+
#+BEGIN_SRC shell-script
104+
$ sudo systemctl enable i3lock@<user>
105+
#+END_SRC
106+
102107
Tlp:
103108
#+BEGIN_SRC shell-script
104109
$ systemctl enable tlp.service

packages

-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ xorg-xinput
220220
xorg-xprop
221221
xorg-xrandr
222222
xorg-xsetroot
223-
xss-lock
224223
yt-dlp
225224
yt-dlp-drop-in
226225
zathura
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- conf -*-
2+
3+
[Unit]
4+
Description=Lock the screen with i3lock
5+
Before=sleep.target
6+
7+
[Service]
8+
User=%I
9+
Type=forking
10+
Environment=DISPLAY=:0
11+
Environment=XDG_CACHE_HOME=/home/%I/.cache
12+
ExecStart=/bin/setsid -f /home/%I/.local/bin/wm/lock.sh
13+
ExecStartPost=/bin/sleep 1
14+
15+
[Install]
16+
WantedBy=sleep.target
17+
18+
# Reference:
19+
# https://wiki.archlinux.org/title/Power_management#Sleep_hooks

0 commit comments

Comments
 (0)