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 ConditionPathExists=/sys/class/bluetooth
[Service] [Service]
Type=simple
ExecStart=/usr/bin/blueman-applet ExecStart=/usr/bin/blueman-applet
Restart=on-failure Restart=on-failure
Slice=background.slice
[Install] [Install]
WantedBy=desktop.target 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 ExecStart=/usr/bin/i3
ExecReload=/usr/bin/i3-msg reload ExecReload=/usr/bin/i3-msg reload
Restart=always Restart=always
Slice=session.slice
[Install] [Install]
WantedBy=graphical-session.target WantedBy=graphical-session.target

View File

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

View File

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

View File

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

View File

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

View File

@ -4,10 +4,10 @@ Requires=graphical-session.target
After=graphical-session.target pulseaudio.socket i3.service After=graphical-session.target pulseaudio.socket i3.service
[Service] [Service]
Type=simple
ExecStart=/usr/bin/polybar --reload --log=warning %i ExecStart=/usr/bin/polybar --reload --log=warning %i
ExecReload=/usr/bin/polybar-msg cmd restart -p $MAINPID ExecReload=/usr/bin/polybar-msg cmd restart -p $MAINPID
Restart=always Restart=always
Slice=session.slice
[Install] [Install]
WantedBy=desktop.target 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 ExecStart=/usr/bin/solaar --debug --restart-on-wake-up --window=hide
KillMode=process KillMode=process
Restart=on-failure Restart=on-failure
Slice=background.slice
[Install] [Install]
WantedBy=desktop.target WantedBy=desktop.target

View File

@ -4,12 +4,12 @@ Requires=graphical-session.target
After=graphical-session.target After=graphical-session.target
[Service] [Service]
Type=simple
Environment=FEH_OPTIONS="--no-fehbg --no-xinerama" Environment=FEH_OPTIONS="--no-fehbg --no-xinerama"
Environment=WALLPAPER=/home/frebib/pictures/lakesidesunrise.jpg Environment=WALLPAPER=/home/frebib/pictures/lakesidesunrise.jpg
ExecStartPre=feh $FEH_OPTIONS --bg-fill $WALLPAPER 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" 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 Restart=always
Slice=session.slice
[Install] [Install]
WantedBy=desktop.target 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 ExecStart=/usr/bin/xautolock -time 5 -locker 'dm-tool switch-to-greeter' -detectsleep -resetsaver -secure
KillMode=process KillMode=process
Restart=on-failure Restart=on-failure
Slice=session.slice
[Install] [Install]
WantedBy=graphical-session.target WantedBy=graphical-session.target

View File

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

View File

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

View File

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