fix: use loginctl lock-session as fallback in case system_actions was not readable

This commit is contained in:
MabaKalox 2025-02-25 20:13:24 +02:00 committed by GitHub
parent 7899fccbbe
commit 267bb837f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {