fix: adapt Sleex to work on runit systems (for Kira Linux)#140
fix: adapt Sleex to work on runit systems (for Kira Linux)#140OxoGhost01 wants to merge 2 commits into
Conversation
| -- 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 &") |
There was a problem hiding this comment.
Why is this necessary ? This env var is already defined in envs.lua
There was a problem hiding this comment.
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
| # 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 |
There was a problem hiding this comment.
What about the listener if no systemd ?
There was a problem hiding this comment.
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"]); |
There was a problem hiding this comment.
loginctl doesn't have --firmware-setup. Only systemctl has this binding.
|
@LeVraiArdox is this the shigami-linux guy? |
that's me yes ^^ |
Sleex currently hard-depends on
systemctlin 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 callsystemctl --user(env import + startingsleex-lock-listener.service) when a systemd user manager is actually present (/run/systemd/systemcheck); fall back todbus-update-activation-environmentdirectly otherwise.greetd.qml,Idle.qml,LockSurface.qml,Session.qml,hypridle.conf,wlogout/layout): replacedsystemctl suspend/poweroff/reboot/hibernatewithloginctlequivalents.loginctltalks to the sameorg.freedesktop.login1D-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.