1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

systemd: assign default slices to user services

As per recommendations in the systemd documentation, assign session, app
or background slice allocations to the standard user services:
https://github.com/systemd/systemd/blob/master/docs/DESKTOP_ENVIRONMENTS.md#pre-defined-systemd-units

Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
Joe Groocock 2020-08-23 01:16:54 +01:00
parent ed2fa7076c
commit e0ff04168a
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
16 changed files with 19 additions and 6 deletions

View File

@ -5,9 +5,9 @@ Requires=graphical-session.target
ConditionPathExists=/sys/class/bluetooth
[Service]
Type=simple
ExecStart=/usr/bin/blueman-applet
Restart=on-failure
Slice=background.slice
[Install]
WantedBy=desktop.target

View File

@ -0,0 +1,2 @@
[Service]
Slice=session.slice

View File

@ -8,6 +8,7 @@ After=xprofile.service xorg.target
ExecStart=/usr/bin/i3
ExecReload=/usr/bin/i3-msg reload
Restart=always
Slice=session.slice
[Install]
WantedBy=graphical-session.target

View File

@ -7,6 +7,7 @@ Requires=graphical-session.target
Type=simple
ExecStart=/usr/bin/nm-applet
Restart=on-failure
Slice=background.slice
[Install]
WantedBy=desktop.target

View File

@ -4,11 +4,10 @@ Requires=graphical-session.target
After=graphical-session.target
[Service]
Type=simple
ExecStart=/usr/bin/nextcloud --background
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
Slice=app.slice
[Install]
WantedBy=desktop.target

View File

@ -6,6 +6,7 @@ After=xorg.target
[Service]
ExecStart=/usr/bin/parcellite -n
Slice=session.slice
[Install]
WantedBy=graphical-session.target

View File

@ -4,9 +4,9 @@ Requires=graphical-session.target
After=dbus.service graphical-session.target xorg.target
[Service]
Type=simple
ExecStart=/usr/bin/picom --experimental-backends --dbus
Restart=always
Slice=session.slice
[Install]
WantedBy=desktop.target

View File

@ -4,10 +4,10 @@ Requires=graphical-session.target
After=graphical-session.target pulseaudio.socket i3.service
[Service]
Type=simple
ExecStart=/usr/bin/polybar --reload --log=warning %i
ExecReload=/usr/bin/polybar-msg cmd restart -p $MAINPID
Restart=always
Slice=session.slice
[Install]
WantedBy=desktop.target

View File

@ -0,0 +1,2 @@
[Service]
Slice=session.slice

View File

@ -0,0 +1,2 @@
[Service]
Slice=session.slice

View File

@ -8,6 +8,7 @@ Type=simple
ExecStart=/usr/bin/solaar --debug --restart-on-wake-up --window=hide
KillMode=process
Restart=on-failure
Slice=background.slice
[Install]
WantedBy=desktop.target

View File

@ -4,12 +4,12 @@ Requires=graphical-session.target
After=graphical-session.target
[Service]
Type=simple
Environment=FEH_OPTIONS="--no-fehbg --no-xinerama"
Environment=WALLPAPER=/home/frebib/pictures/lakesidesunrise.jpg
ExecStartPre=feh $FEH_OPTIONS --bg-fill $WALLPAPER
ExecStart=/bin/sh -c "xev -root -event randr 2>&1 | while awk -v RS=\\n\\n '{exit;}'; do echo 'Applying wallpaper'; feh $FEH_OPTIONS --bg-fill $WALLPAPER; done"
Restart=always
Slice=session.slice
[Install]
WantedBy=desktop.target

View File

@ -7,6 +7,7 @@ After=xorg.target
ExecStart=/usr/bin/xautolock -time 5 -locker 'dm-tool switch-to-greeter' -detectsleep -resetsaver -secure
KillMode=process
Restart=on-failure
Slice=session.slice
[Install]
WantedBy=graphical-session.target

View File

@ -4,6 +4,7 @@ Description=XBindKeys
[Service]
ExecStart=/usr/bin/xbindkeys -n -f $XDG_CONFIG_HOME/X11/xbindkeysrc
KillMode=process
Slice=session.slice
[Install]
WantedBy=graphical-session.target

View File

@ -7,6 +7,7 @@ After=xorg.target
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c '. $XDG_CONFIG_HOME/X11/xprofile; systemctl --user import-environment'
Slice=session.slice
[Install]
WantedBy=xorg.target

View File

@ -7,6 +7,7 @@ After=xorg.target
ExecStart=/bin/sh -c 'xsettingsd -c $XDG_CONFIG_HOME/xsettingsd/xsettingsd.local'
ExecReload=/bin/kill -s HUP $MAINPID
Restart=always
Slice=session.slice
[Install]
WantedBy=graphical-session.target