Config: Actually lock the screen before going to sleep, using systemd

This commit is contained in:
Riyyi
2022-09-02 15:52:56 +02:00
parent c3811b7f78
commit cf417d95b2
5 changed files with 28 additions and 5 deletions
-1
View File
@@ -23,7 +23,6 @@ emacs --daemon &
thunar --daemon &
sxhkd "$XDG_CONFIG_HOME/sxhkd/$WM" &
xss-lock -- "$HOME/.local/bin/wm/lock.sh" &
/usr/lib/polkit-kde-authentication-agent-1 &
+2 -1
View File
@@ -51,6 +51,7 @@ i3lock -n -i "$LOCK" -B 6 -S 1 -e \
--time-size=64 --date-size=24 \
--time-str="%I:%M %p" --date-str="%A, %B %e" \
--time-pos="ix:iy-250" --date-pos="ix:iy-200" \
--time-color=FFFFFFC0 --date-color=FFFFFFC0
--time-color=FFFFFFC0 --date-color=FFFFFFC0 \
--no-modkey-text
revert
+7 -2
View File
@@ -65,8 +65,8 @@ $ sudo EDITOR=vim visudo
Add user:
#+BEGIN_SRC shell-script
$ useradd -m -G wheel -s /bin/bash <username>
$ passwd <username>
$ useradd -m -G wheel -s /bin/bash <user>
$ passwd <user>
#+END_SRC
Pacman colors:
@@ -99,6 +99,11 @@ $ git config --global user.email "<email address>"
$ git config --global user.name "<name>"
#+END_SRC
Lock before sleep:
#+BEGIN_SRC shell-script
$ sudo systemctl enable i3lock@<user>
#+END_SRC
Tlp:
#+BEGIN_SRC shell-script
$ systemctl enable tlp.service
-1
View File
@@ -220,7 +220,6 @@ xorg-xinput
xorg-xprop
xorg-xrandr
xorg-xsetroot
xss-lock
yt-dlp
yt-dlp-drop-in
zathura
+19
View File
@@ -0,0 +1,19 @@
# -*- conf -*-
[Unit]
Description=Lock the screen with i3lock
Before=sleep.target
[Service]
User=%I
Type=forking
Environment=DISPLAY=:0
Environment=XDG_CACHE_HOME=/home/%I/.cache
ExecStart=/bin/setsid -f /home/%I/.local/bin/wm/lock.sh
ExecStartPost=/bin/sleep 1
[Install]
WantedBy=sleep.target
# Reference:
# https://wiki.archlinux.org/title/Power_management#Sleep_hooks