From 267bb837f127eb805a17250ebcad02db57eb72cb Mon Sep 17 00:00:00 2001 From: MabaKalox <52936597+MabaKalox@users.noreply.github.com> Date: Tue, 25 Feb 2025 20:13:24 +0200 Subject: [PATCH] fix: use `loginctl lock-session` as fallback in case system_actions was not readable --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index fb08a3f..6065b6f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,12 +171,11 @@ impl State { } fn lock_screen(&self) { - if let Some(command) = self + let command = self .system_actions .get(&shortcuts::action::System::LockScreen) - { - crate::run_command(command.to_string()); - } + .map_or("loginctl lock-session", |s| s.as_str()); + crate::run_command(command.to_string()); } fn update_suspend_idle(&mut self, is_idle: bool) {