Lock: add session lock from power button and chandra-ctl lock
CI / test (push) Failing after 52s

- Lock the session from the power button or `chandra-ctl lock`
- Unlock with a face or the password; the password always works
- Add compositor lock module with tests, and a polkit unlock policy (org.chandra.unlock)
- Document the lock flow in docs/lock.md and link it from the README
- Add generated interface bindings for the compositor and widget components
This commit is contained in:
nandi committed 2026-11-29 03:24:46 -08:00
1 parent 7501fc3ad9
commit c790f96e58
131 files changed
+4693 -274

No files matched your search

+39
View File
@@ -301,6 +301,7 @@ pub fn ChandraCompositor::control_command(self : ChandraCompositor, line : Strin
"screenshot [PATH] save a full-screen PNG directly (without opening the editor)",
"rotate [cw|ccw|flip|0|90|180|270|status] rotate or flip the display",
"screen [on|off|toggle|status] blank or wake the display",
"lock [lock|status|on-blank [on|off|status]] lock the session or configure lock-on-blank",
"brightness [PCT|status] read or set display backlight percent (5..100)",
"volume [up|down|mute|unmute|toggle|PCT|status] read or adjust audio volume",
"osk [on|off|toggle|status] enable, disable, or query the on-screen keyboard",
@@ -491,6 +492,44 @@ pub fn ChandraCompositor::control_command(self : ChandraCompositor, line : Strin
_ => (["error usage: rotate [cw|ccw|flip|0|90|180|270|status]"], false)
}
}
"lock" => {
let arg = if words.length() >= 2 { words[1] } else { "lock" }
let usage = "error usage: lock [lock|status|on-blank [on|off|status]]"
match arg {
"status" =>
if words.length() > 2 {
([usage], false)
} else {
(["ok " + (if self.locked { "locked" } else { "unlocked" })], true)
}
"lock" =>
if words.length() > 2 {
([usage], false)
} else {
self.lock_now()
(["ok locked"], true)
}
"on-blank" => {
if words.length() > 3 {
return ([usage], false)
}
let sub = if words.length() >= 3 { words[2] } else { "status" }
match sub {
"status" => (["ok " + (if self.lock_on_blank { "on" } else { "off" })], true)
"on" => {
self.lock_on_blank = true
(["ok on"], true)
}
"off" => {
self.lock_on_blank = false
(["ok off"], true)
}
_ => ([usage], false)
}
}
_ => ([usage], false)
}
}
"screen" => {
let arg = if words.length() >= 2 { words[1] } else { "status" }
if words.length() > 2 {