1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-03 11:41:04 +02:00
ironbar/src/ipc/commands.rs

41 lines
1 KiB
Rust
Raw Normal View History

2023-06-22 23:06:45 +01:00
use clap::Subcommand;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
#[derive(Subcommand, Debug, Serialize, Deserialize)]
2023-07-09 19:59:17 +01:00
#[serde(tag = "type", rename_all = "snake_case")]
2023-06-22 23:06:45 +01:00
pub enum Command {
/// Return "ok"
Ping,
/// Open the GTK inspector
Inspect,
2023-07-01 00:05:12 +01:00
/// Reload the config
Reload,
/// Set an `ironvar` value.
/// This creates it if it does not already exist, and updates it if it does.
/// Any references to this variable are automatically and immediately updated.
/// Keys and values can be any valid UTF-8 string.
Set {
2023-07-01 00:05:12 +01:00
/// Variable key. Can be any alphanumeric ASCII string.
key: Box<str>,
/// Variable value. Can be any valid UTF-8 string.
value: String,
},
/// Get the current value of an `ironvar`.
Get {
/// Variable key.
key: Box<str>,
},
/// Load an additional CSS stylesheet.
/// The sheet is automatically hot-reloaded.
LoadCss {
/// The path to the sheet.
path: PathBuf,
},
}