Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sleex-user-config/src/.config/hypr/hypridle.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ listener {

listener {
timeout = 600 # 10min
on-timeout = systemctl suspend # suspend pc
on-timeout = loginctl suspend # suspend pc
}
8 changes: 4 additions & 4 deletions sleex-user-config/src/.config/wlogout/layout
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
{
"label" : "hibernate",
"action" : "systemctl hibernate || loginctl hibernate",
"action" : "loginctl hibernate",
"text" : "save",
"keybind" : "h"
}
Expand All @@ -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"
}
9 changes: 7 additions & 2 deletions src/bin/sleex
Original file line number Diff line number Diff line change
@@ -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
Comment on lines +5 to +11

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)


# 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
Expand Down
2 changes: 1 addition & 1 deletion src/etc/sleex/hyprland/execs.lua
Original file line number Diff line number Diff line change
@@ -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 &")

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


-- Core components (authentication, lock screen, notification daemon)
hl.exec_cmd("dbus-update-activation-environment --all")
Expand Down
6 changes: 3 additions & 3 deletions src/share/sleex/greetd.qml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ ShellRoot {
color: Appearance.colors.colOnLayer0
anchors.centerIn: parent
}
onClicked: Quickshell.execDetached(["systemctl", "suspend"])
onClicked: Quickshell.execDetached(["loginctl", "suspend"])
}

RippleButton {
Expand All @@ -385,7 +385,7 @@ ShellRoot {
anchors.centerIn: parent
color: Appearance.colors.colOnLayer0
}
onClicked: Quickshell.execDetached(["systemctl", "reboot"])
onClicked: Quickshell.execDetached(["loginctl", "reboot"])
}

RippleButton {
Expand All @@ -401,7 +401,7 @@ ShellRoot {
anchors.centerIn: parent
color: Appearance.colors.colOnLayer0
}
onClicked: Quickshell.execDetached(["systemctl", "poweroff"])
onClicked: Quickshell.execDetached(["loginctl", "poweroff"])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/share/sleex/modules/common/Idle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions src/share/sleex/modules/lockscreen/LockSurface.qml
Original file line number Diff line number Diff line change
Expand Up @@ -444,22 +444,22 @@ 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
colBackgroundHover: Appearance.colors.colErrorContainer
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"])
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/share/sleex/modules/session/Session.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/share/sleex/services/Idle.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down