this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

avarna: fix locking/suspending

Aria 69c9b6d1 75637e79

+82 -15
-4
nix/hosts/avarna.nix
··· 165 165 scale 1.3 166 166 } 167 167 ''; 168 - 169 - services.logind.settings.Login.LidSwitch = "sleep"; 170 - services.logind.settings.Login.PowerKey = "sleep"; 171 - services.logind.settings.Login.PowerKeyLongPress = "poweroff"; 172 168 }
+5 -8
nix/npins/sources.json
··· 104 104 "hash": "sha256-79JP2QTdvp1jg7HGxAW+xzhzhLnlKUi8yGXq9nDCeH0=" 105 105 }, 106 106 "noctalia-shell": { 107 - "type": "GitRelease", 107 + "type": "Git", 108 108 "repository": { 109 109 "type": "GitHub", 110 110 "owner": "noctalia-dev", 111 111 "repo": "noctalia-shell" 112 112 }, 113 - "pre_releases": false, 114 - "version_upper_bound": null, 115 - "release_prefix": null, 113 + "branch": "main", 116 114 "submodules": false, 117 - "version": "v4.7.5", 118 - "revision": "8b0c7c288063e5048a439ca308dd65f7044f42b6", 119 - "url": "https://api.github.com/repos/noctalia-dev/noctalia-shell/tarball/refs/tags/v4.7.5", 120 - "hash": "sha256-0xoCuJSRSWcn4mCX382lCxqLbnuOrrqS4dOcdpoUmZg=" 115 + "revision": "819b2d33b04b2180b6ef19dab7f86af7d3603a52", 116 + "url": "https://github.com/noctalia-dev/noctalia-shell/archive/819b2d33b04b2180b6ef19dab7f86af7d3603a52.tar.gz", 117 + "hash": "sha256-yZIMJhv1Jg2I1bsag/chncl4nb/5pkrEKVwpkOqJqpI=" 121 118 }, 122 119 "tangled": { 123 120 "type": "GitRelease",
+13 -3
nix/pkgs/default.nix
··· 96 96 }; 97 97 98 98 # From inputs.noctalia-shell 99 - noctalia-shell = final.callPackage "${inputs.noctalia-shell}/nix/package.nix" { 100 - version = inputs.noctalia-shell.version; 101 - }; 99 + noctalia-shell = 100 + (final.callPackage "${inputs.noctalia-shell}/nix/package.nix" { 101 + version = "dev-${inputs.noctalia-shell.revision}"; 102 + }).overrideAttrs 103 + ( 104 + _: p: 105 + p 106 + // rec { 107 + # Credit: @Aitor42 on github 108 + # https://github.com/noctalia-dev/noctalia-shell/pull/2176 109 + patches = [ ./noctalia-shell-2176-lock-before-sleep.patch ]; 110 + } 111 + ); 102 112 }
+64
nix/pkgs/noctalia-shell-2176-lock-before-sleep.patch
··· 1 + From 19070260e95435fdf4d82d7d650e68d572e8964e Mon Sep 17 00:00:00 2001 2 + From: Aitor <aitor.rufian@alu.uclm.es> 3 + Date: Sat, 14 Mar 2026 10:57:18 +0100 4 + Subject: [PATCH] Respect lockOnSuspend in all suspend cases 5 + 6 + --- 7 + Services/Compositor/CompositorService.qml | 44 +++++++++++++++++++++++ 8 + 1 file changed, 44 insertions(+) 9 + 10 + diff --git a/Services/Compositor/CompositorService.qml b/Services/Compositor/CompositorService.qml 11 + index f9f7427ef2..2006a2d7a9 100644 12 + --- a/Services/Compositor/CompositorService.qml 13 + +++ b/Services/Compositor/CompositorService.qml 14 + @@ -562,6 +562,50 @@ Singleton { 15 + } 16 + } 17 + 18 + + // Lock screen before external suspend (power button, lid close) by 19 + + // monitoring systemd-logind's PrepareForSleep D-Bus signal. 20 + + Process { 21 + + id: sleepMonitor 22 + + running: true 23 + + command: [ 24 + + "gdbus", "monitor", "--system", 25 + + "--dest", "org.freedesktop.login1", 26 + + "--object-path", "/org/freedesktop/login1" 27 + + ] 28 + + 29 + + stdout: SplitParser { 30 + + onRead: line => { 31 + + if (line.indexOf("PrepareForSleep") !== -1 && line.indexOf("true") !== -1) 32 + + root._lockIfNeeded("PrepareForSleep"); 33 + + } 34 + + } 35 + + 36 + + onExited: () => sleepMonitorRestart.start() 37 + + } 38 + + 39 + + Timer { 40 + + id: sleepMonitorRestart 41 + + interval: 2000 42 + + onTriggered: sleepMonitor.running = true 43 + + } 44 + + 45 + + // Fallback: lock on resume via time-jump detection if D-Bus signal was missed. 46 + + Connections { 47 + + target: Time 48 + + function onResumed() { 49 + + root._lockIfNeeded("resume fallback"); 50 + + } 51 + + } 52 + + 53 + + function _lockIfNeeded(source) { 54 + + if (!Settings.data.general.lockOnSuspend) 55 + + return; 56 + + if (!PanelService || !PanelService.lockScreen || PanelService.lockScreen.active) 57 + + return; 58 + + Logger.i("Compositor", "Locking screen (" + source + ")"); 59 + + root.lock(); 60 + + } 61 + + 62 + property int lockAndSuspendCheckCount: 0 63 + 64 + function lockAndSuspend() {