Skip to content

fix: adapt Sleex to work on runit systems (for Kira Linux)#140

Open
OxoGhost01 wants to merge 2 commits into
AxOS-project:mainfrom
shinigami-os:Adapting-Sleex-to-runit-systems
Open

fix: adapt Sleex to work on runit systems (for Kira Linux)#140
OxoGhost01 wants to merge 2 commits into
AxOS-project:mainfrom
shinigami-os:Adapting-Sleex-to-runit-systems

Conversation

@OxoGhost01

@OxoGhost01 OxoGhost01 commented Jul 16, 2026

Copy link
Copy Markdown

Sleex currently hard-depends on systemctl in a few places, which don't exist on non-systemd init systems (runit, in my case: Kira Linux). This makes Sleex fail outright on those systems even though nothing here actually needs systemd specifically.

  • src/bin/sleex: only call systemctl --user (env import + starting sleex-lock-listener.service) when a systemd user manager is actually present (/run/systemd/system check); fall back to dbus-update-activation-environment directly otherwise.
  • Everywhere else (greetd.qml, Idle.qml, LockSurface.qml, Session.qml, hypridle.conf, wlogout/layout): replaced systemctl suspend/poweroff/reboot/hibernate with loginctl equivalents. loginctl talks to the same org.freedesktop.login1 D-Bus API whether it's backed by systemd-logind or elogind, so this works identically on both systemd and non-systemd systems. No behavior change on systemd, it just stops assuming systemd's service manager is the only way to reach logind.
  • Tested on Kira Linux (runit + elogind); doesn't touch anything systemd-specific behavior depends on, so it should be a no-op for existing systemd users.

@LeVraiArdox LeVraiArdox left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Although this is a good idea, there are some stuff to fix

-- Bar, wallpaper
-- hl.dsp.exec_cmd("swww-daemon")
hl.exec_cmd("qs -p /usr/share/sleex &")
hl.exec_cmd("QT_QPA_PLATFORM=wayland qs -p /usr/share/sleex &")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary ? This env var is already defined in envs.lua

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I digged into that : hyprland.env is never required anywhere in hyprland.lua's load chain, so none of the hl.env() calls in it, including this one, ever actually run.
That's a separate pre-existing bug, but it's why qs was landing on xcb without this (on Kira). Happy to instead fix it by adding require("hyprland.env") to hyprland.lua if you'd rather fix the root cause than carry the inline duplicate

Comment thread src/bin/sleex
Comment on lines +5 to +11
# systemctl --user only exists on systemd; use dbus directly otherwise
if [ -d /run/systemd/system ]; then
systemctl --user import-environment XDG_CURRENT_DESKTOP
systemctl --user start sleex-lock-listener.service
else
dbus-update-activation-environment XDG_CURRENT_DESKTOP
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the listener if no systemd ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, the equivalent would be backgrounding the same dbus-monitor-based loop the systemd unit runs, but that needs a D-Bus system-bus monitor policy (BecomeMonitor/eavesdrop permission) that not every non-systemd distro ships by default.
And since it actually works right now via direct triggers (idle timeout, manual lock keybind), i don't really want to dig into creating a fallback x)

buttonIcon: "settings_applications"
buttonText: qsTr("Reboot to firmware settings")
onClicked: Quickshell.execDetached(["systemctl", "reboot", "--firmware-setup"]);
onClicked: Quickshell.execDetached(["loginctl", "reboot", "--firmware-setup"]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loginctl doesn't have --firmware-setup. Only systemctl has this binding.

@Byson94

Byson94 commented Jul 17, 2026

Copy link
Copy Markdown
Member

@LeVraiArdox is this the shigami-linux guy?

@OxoGhost01

Copy link
Copy Markdown
Author

@LeVraiArdox is this the shigami-linux guy?

that's me yes ^^
btw : 'Shinigami' XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants