Publish theme snapshots through IPC from explicit live state

This commit is contained in:
Samuel Onoja committed 2026-10-03 00:05:29 +01:00
1 parent 8195b82073
commit ccf7497b6f
23 files changed
+287 -130

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ license.workspace = true
rust-version.workspace = true
[dependencies]
ferese-config = { path = "../crates/ferese-config" }
ferese-ipc = { path = "../crates/ferese-ipc" }
serde_json.workspace = true
libc.workspace = true
+6 -3
View File
@@ -50,13 +50,16 @@ fn theme_command(args: Vec<String>) -> Result<(), Box<dyn Error>> {
let mut connection = ferese_ipc::theme::Connection::connect()?;
match args.as_slice() {
[command] if command == "get" || command == "status" => {
println!("{}", serde_json::to_string_pretty(&connection.get()?)?);
println!(
"{}",
serde_json::to_string_pretty(&connection.get(ferese_config::families::builtins)?)?
);
}
[command] if command == "subscribe" => {
let mut snapshot = connection.get()?;
let mut snapshot = connection.get(ferese_config::families::builtins)?;
loop {
println!("{}", serde_json::to_string(&snapshot)?);
snapshot = connection.watch(snapshot.revision)?;
snapshot = connection.watch(snapshot.revision, ferese_config::families::builtins)?;
}
}
[command, mode] if command == "mode" && matches!(mode.as_str(), "light" | "dark" | "auto") => {