1
0
mirror of https://gitlab.com/dbrw/ansible-setup.git synced 2026-02-06 01:05:32 +07:00

update user services

This commit is contained in:
dbrw
2022-07-08 16:09:22 +07:00
parent 09279bbacb
commit 5fd615cc54
7 changed files with 95 additions and 30 deletions

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Services which should run when session is locked
Documentation=man:systemd.special(7)
Requires=lock-helper.service
BindsTo=graphical-session.target dwm.service
Conflicts=unlock.target
After=graphical-session.target
StopWhenUnneeded=yes

View File

@@ -0,0 +1,21 @@
[Unit]
Description=slock -- suckless screen locker
Documentation=man:slock(1) man:xss-lock(1)
PartOf=lock.target
Conflicts=unclutter.service
After=lock.target
RefuseManualStop=yes
[Service]
Type=simple
ExecStartPre=/usr/bin/xset +dpms dpms 0 0 ${DPMS_TIMEOUT}
ExecStart=/usr/local/bin/slock -m "ANTI SUCK-SUCK CLUB"
ExecStopPost=/bin/systemctl --user --no-block start xset-dpms.service
ExecStopPost=/bin/systemctl --user --no-block start unclutter.service
Restart=on-failure
RestartSec=2
[Install]
WantedBy=lock.target
WantedBy=sleep.target

View File

@@ -0,0 +1,15 @@
[Unit]
Description=Unclutter, hide mouse cursor on idle
Documentation=man:unclutter(1)
PartOf=graphical-session.target
After=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/bin/unclutter -display ${DISPLAY} -idle 2 -jitter 3 -grab -root
Restart=on-failure
RestartSec=2
[Install]
WantedBy=graphical-session.target

View File

@@ -0,0 +1,5 @@
[Unit]
Description=Services which should run when session is unlocked
Documentation=man:systemd.special(7)
Conflicts=lock.target
StopWhenUnneeded=yes

View File

@@ -0,0 +1,15 @@
[Unit]
Description=XScreenSaver Utility
Documentation=man:xss-lock(1)
PartOf=graphical-session.target
After=graphical-session.target
Before=xset-xss.service
[Service]
Type=simple
ExecStart=/usr/bin/xss-lock -s ${XDG_SESSION_ID} --ignore-sleep -- systemctl --user --wait start lock.target
Restart=always
RestartSec=2
[Install]
WantedBy=graphical-session.target

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Import environemnt to systemd user session
systemctl --user import-environment DISPLAY XAUTHORITY PATH
systemctl --user import-environment DISPLAY XAUTHORITY PATH XDG_SESSION_ID
# Run graphical-session.target
systemctl --user start --wait xorg.target