From edbbf7930242cf7f1403bb02e4f68ced698eaab3 Mon Sep 17 00:00:00 2001 From: ManInDark <61268856+ManInDark@users.noreply.github.com> Date: Tue, 6 Jan 2026 21:26:03 +0100 Subject: [PATCH] feat: autostart hyprland with systemd --- build_files/02_hyprland.sh | 4 ++- build_files/hyprland.service | 50 ++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 build_files/hyprland.service diff --git a/build_files/02_hyprland.sh b/build_files/02_hyprland.sh index dc867da..c77203a 100755 --- a/build_files/02_hyprland.sh +++ b/build_files/02_hyprland.sh @@ -7,4 +7,6 @@ dnf5 install -y \ hyprland \ hypridle \ hyprlock \ - hyprpolkitagent \ No newline at end of file + hyprpolkitagent + +cp /ctx/hypr* /usr/lib/systemd/system \ No newline at end of file diff --git a/build_files/hyprland.service b/build_files/hyprland.service new file mode 100644 index 0000000..eebc1d0 --- /dev/null +++ b/build_files/hyprland.service @@ -0,0 +1,50 @@ +# /usr/lib/systemd/system/gdm.service +[Unit] +Description=Hyprland + +# replaces the getty +Conflicts=getty@tty1.service +After=getty@tty1.service + +# replaces plymouth-quit since it quits plymouth on its own +Conflicts=plymouth-quit.service +After=plymouth-quit.service + +# Needs all the dependencies of the services it's replacing +# pulled from getty@.service and plymouth-quit.service +# (except for plymouth-quit-wait.service since it waits until +# plymouth is quit, which we do) +After=rc-local.service plymouth-start.service systemd-user-sessions.service + +# GDM takes responsibility for stopping plymouth, so if it fails +# for any reason, make sure plymouth still stops +OnFailure=plymouth-quit.service + +[Service] +ExecStart=/usr/bin/hyprland +KillMode=mixed +Restart=always +IgnoreSIGPIPE=no +BusName=org.freedesktop.portal.Desktop +EnvironmentFile=-/etc/locale.conf +ExecReload=/bin/kill -SIGHUP $MAINPID +KeyringMode=shared + +[Install] +Alias=display-manager.service + +# /usr/lib/systemd/system/service.d/10-timeout-abort.conf +# This file is part of the systemd package. +# See https://fedoraproject.org/wiki/Changes/Shorter_Shutdown_Timer. +# +# To facilitate debugging when a service fails to stop cleanly, +# TimeoutStopFailureMode=abort is set to "crash" services that fail to stop in +# the time allotted. This will cause the service to be terminated with SIGABRT +# and a coredump to be generated. +# +# To undo this configuration change, create a mask file: +# sudo mkdir -p /etc/systemd/system/service.d +# sudo ln -sv /dev/null /etc/systemd/system/service.d/10-timeout-abort.conf + +[Service] +TimeoutStopFailureMode=abort