diff --git a/sleex-user-config/src/.config/hypr/hypridle.conf b/sleex-user-config/src/.config/hypr/hypridle.conf index 98f11f27..2741fc1d 100755 --- a/sleex-user-config/src/.config/hypr/hypridle.conf +++ b/sleex-user-config/src/.config/hypr/hypridle.conf @@ -32,5 +32,5 @@ listener { listener { timeout = 600 # 10min - on-timeout = systemctl suspend # suspend pc + on-timeout = loginctl suspend # suspend pc } diff --git a/sleex-user-config/src/.config/wlogout/layout b/sleex-user-config/src/.config/wlogout/layout index c31abd94..7a935107 100644 --- a/sleex-user-config/src/.config/wlogout/layout +++ b/sleex-user-config/src/.config/wlogout/layout @@ -6,7 +6,7 @@ } { "label" : "hibernate", - "action" : "systemctl hibernate || loginctl hibernate", + "action" : "loginctl hibernate", "text" : "save", "keybind" : "h" } @@ -18,19 +18,19 @@ } { "label" : "shutdown", - "action" : "systemctl poweroff || loginctl poweroff", + "action" : "loginctl poweroff", "text" : "power_settings_new", "keybind" : "s" } { "label" : "suspend", - "action" : "systemctl suspend || loginctl suspend", + "action" : "loginctl suspend", "text" : "bedtime", "keybind" : "u" } { "label" : "reboot", - "action" : "systemctl reboot || loginctl reboot", + "action" : "loginctl reboot", "text" : "restart_alt", "keybind" : "r" } diff --git a/src/bin/sleex b/src/bin/sleex index 38a3bea9..8531fd11 100755 --- a/src/bin/sleex +++ b/src/bin/sleex @@ -1,9 +1,14 @@ #!/bin/sh export XDG_CURRENT_DESKTOP="Sleex" export HYPRLAND_INSTANCE_SIGNATURE="" -systemctl --user import-environment XDG_CURRENT_DESKTOP -systemctl --user start sleex-lock-listener.service +# 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 # Check if config dirs/files exist, if not copy them from /etc/skel for dir in fish hypr anyrun fuzzel Kvantum matugen vdirsyncer kde-material-you-colors mpv wlogout qt5ct xdg-desktop-portal fontconfig khal qt6ct zshrc.d foot; do diff --git a/src/etc/sleex/hyprland/execs.lua b/src/etc/sleex/hyprland/execs.lua index ff2a532d..206c6c4b 100644 --- a/src/etc/sleex/hyprland/execs.lua +++ b/src/etc/sleex/hyprland/execs.lua @@ -1,7 +1,7 @@ hl.on("hyprland.start", function () -- 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 &") -- Core components (authentication, lock screen, notification daemon) hl.exec_cmd("dbus-update-activation-environment --all") diff --git a/src/share/sleex/greetd.qml b/src/share/sleex/greetd.qml index 5f09972b..bc52a9b4 100755 --- a/src/share/sleex/greetd.qml +++ b/src/share/sleex/greetd.qml @@ -370,7 +370,7 @@ ShellRoot { color: Appearance.colors.colOnLayer0 anchors.centerIn: parent } - onClicked: Quickshell.execDetached(["systemctl", "suspend"]) + onClicked: Quickshell.execDetached(["loginctl", "suspend"]) } RippleButton { @@ -385,7 +385,7 @@ ShellRoot { anchors.centerIn: parent color: Appearance.colors.colOnLayer0 } - onClicked: Quickshell.execDetached(["systemctl", "reboot"]) + onClicked: Quickshell.execDetached(["loginctl", "reboot"]) } RippleButton { @@ -401,7 +401,7 @@ ShellRoot { anchors.centerIn: parent color: Appearance.colors.colOnLayer0 } - onClicked: Quickshell.execDetached(["systemctl", "poweroff"]) + onClicked: Quickshell.execDetached(["loginctl", "poweroff"]) } } } diff --git a/src/share/sleex/modules/common/Idle.qml b/src/share/sleex/modules/common/Idle.qml index 2bb5b2be..e1724f6b 100644 --- a/src/share/sleex/modules/common/Idle.qml +++ b/src/share/sleex/modules/common/Idle.qml @@ -70,7 +70,7 @@ Singleton { } property JsonObject suspend: JsonObject { property int timeout: 300 - property string actions: "systemctl suspend" + property string actions: "loginctl suspend" property bool on_battery: true property bool enabled: true } diff --git a/src/share/sleex/modules/lockscreen/LockSurface.qml b/src/share/sleex/modules/lockscreen/LockSurface.qml index 5bb1d798..eb765638 100644 --- a/src/share/sleex/modules/lockscreen/LockSurface.qml +++ b/src/share/sleex/modules/lockscreen/LockSurface.qml @@ -444,7 +444,7 @@ FocusScope { Layout.fillHeight: true; Layout.fillWidth: true buttonRadius: Appearance.rounding.full MaterialSymbol { text: "bedtime"; iconSize: 20; anchors.centerIn: parent; color: Appearance.colors.colOnLayer0 } - onClicked: Quickshell.execDetached(["systemctl", "suspend"]) + onClicked: Quickshell.execDetached(["loginctl", "suspend"]) } RippleButton { colBackground: Appearance.colors.colLayer1 @@ -452,14 +452,14 @@ FocusScope { Layout.fillHeight: true; Layout.fillWidth: true buttonRadius: Appearance.rounding.full MaterialSymbol { text: "power_settings_new"; iconSize: 20; anchors.centerIn: parent; color: Appearance.colors.colOnLayer0 } - onClicked: Quickshell.execDetached(["systemctl", "poweroff"]) + onClicked: Quickshell.execDetached(["loginctl", "poweroff"]) } RippleButton { colBackground: Appearance.colors.colLayer1 Layout.fillHeight: true; Layout.fillWidth: true buttonRadius: Appearance.rounding.full MaterialSymbol { text: "restart_alt"; iconSize: 20; anchors.centerIn: parent; color: Appearance.colors.colOnLayer0 } - onClicked: Quickshell.execDetached(["systemctl", "reboot"]) + onClicked: Quickshell.execDetached(["loginctl", "reboot"]) } } } diff --git a/src/share/sleex/modules/session/Session.qml b/src/share/sleex/modules/session/Session.qml index 9987efca..445c710d 100644 --- a/src/share/sleex/modules/session/Session.qml +++ b/src/share/sleex/modules/session/Session.qml @@ -101,7 +101,7 @@ Scope { id: sessionSleep buttonIcon: "dark_mode" buttonText: qsTr("Sleep") - onClicked: { Quickshell.execDetached(["systemctl", "suspend"]); sessionRoot.hide() } + onClicked: { Quickshell.execDetached(["loginctl", "suspend"]); sessionRoot.hide() } onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText } KeyNavigation.left: sessionLock KeyNavigation.right: sessionLogout @@ -131,7 +131,7 @@ Scope { id: sessionHibernate buttonIcon: "downloading" buttonText: qsTr("Hibernate") - onClicked: Quickshell.execDetached(["systemctl", "hibernate"]); + onClicked: Quickshell.execDetached(["loginctl", "hibernate"]); onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText } KeyNavigation.up: sessionLock KeyNavigation.right: sessionShutdown @@ -140,7 +140,7 @@ Scope { id: sessionShutdown buttonIcon: "power_settings_new" buttonText: qsTr("Shutdown") - onClicked: Quickshell.execDetached(["systemctl", "poweroff"]) + onClicked: Quickshell.execDetached(["loginctl", "poweroff"]) onFocusChanged: { if (focus) sessionRoot.subtitle = buttonText } KeyNavigation.left: sessionHibernate KeyNavigation.right: sessionReboot diff --git a/src/share/sleex/services/Idle.qml b/src/share/sleex/services/Idle.qml index 21b7df54..7958839a 100644 --- a/src/share/sleex/services/Idle.qml +++ b/src/share/sleex/services/Idle.qml @@ -71,7 +71,7 @@ Singleton { } property JsonObject suspend: JsonObject { property int timeout: 300 - property string actions: "systemctl suspend" + property string actions: "loginctl suspend" property bool on_battery: true property bool enabled: true }