Move waybar to a systemd service

This commit is contained in:
2025-05-16 03:50:31 -04:00
parent da3f13eefb
commit e8cf18cbb2
3 changed files with 25 additions and 3 deletions

View File

@@ -3,9 +3,6 @@
$polkit = /usr/libexec/kf6/polkit-kde-authentication-agent-1
#$kwalletInit = exec --no-startup-id /usr/lib/pam_kwallet_init
# menu bar
exec-once = /usr/bin/waybar
# hyprpaper
# exec-once = hyprpaper

View File

@@ -0,0 +1,20 @@
[Unit]
Description=Highly customizable Wayland bar for Sway and Wlroots based compositors.
Documentation=man:waybar(5)
# order startup after WM
After=graphical-session.target
[Service]
Type=exec
# Repurpose XDG Autostart filtering
ExecCondition=/lib/systemd/systemd-xdg-autostart-condition "wlroots:sway:Wayfire:labwc:Hyprland" ""
ExecStart=/usr/bin/waybar
ExecReload=kill -SIGUSR2 $MAINPID
Restart=on-failure
Slice=app-graphical.slice
[Install]
WantedBy=graphical-session.target
# Alternatively can be wanted by specific WMs' targets
# Should also be duplicated in 'After=' to avoid ordering loop
#WantedBy=wayland-session@hyprland.desktop.target

View File

@@ -36,5 +36,10 @@ modules:
- com.discordapp.Discord
user: {} # Also add Flathub user repo, but no user packages
- type: systemd
user:
enabled:
- waybar.service
- type: signing # this sets up the proper policy & signing files for signed images to work fully