mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(session menu): allow for custom lock screen command
This commit is contained in:
@@ -214,10 +214,7 @@ SmartPanel {
|
||||
// Use default behavior or custom command handled by CompositorService
|
||||
switch (action) {
|
||||
case "lock":
|
||||
// Access lockScreen via PanelService
|
||||
if (PanelService.lockScreen && !PanelService.lockScreen.active) {
|
||||
PanelService.lockScreen.active = true;
|
||||
}
|
||||
CompositorService.lock();
|
||||
break;
|
||||
case "suspend":
|
||||
// Check if we should lock before suspending
|
||||
|
||||
@@ -487,6 +487,17 @@ Singleton {
|
||||
Quickshell.execDetached(["sh", "-c", "systemctl suspend || loginctl suspend"]);
|
||||
}
|
||||
|
||||
|
||||
function lock() {
|
||||
Logger.i("Compositor", "LockScreen requested");
|
||||
if (executeSessionAction("lock"))
|
||||
return;
|
||||
|
||||
if (PanelService && PanelService.lockScreen) {
|
||||
PanelService.lockScreen.active = true;
|
||||
}
|
||||
}
|
||||
|
||||
function hibernate() {
|
||||
Logger.i("Compositor", "Hibernate requested");
|
||||
if (executeSessionAction("hibernate"))
|
||||
|
||||
Reference in New Issue
Block a user