Add build output dependency file for mouse-test application
Add standard menu fore keybinds
This commit is contained in:
@@ -18,6 +18,9 @@ pub struct KeybindConfig {
|
||||
#[serde(default)]
|
||||
pub scope: KeybindScope,
|
||||
pub action: MenuAction,
|
||||
/// Visningsnamn som visas i TUI-WM-menyn (valfritt)
|
||||
#[serde(default)]
|
||||
pub label: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Debug, Clone, Default, PartialEq)]
|
||||
@@ -77,6 +80,8 @@ pub enum MenuAction {
|
||||
},
|
||||
/// Öppnar Tui-run kommandodialog
|
||||
SpawnRunDialog,
|
||||
/// Gör ingenting – används för display-only rader i menyer
|
||||
NoOp,
|
||||
}
|
||||
|
||||
/// En status-widget i panelen: kör ett kommando periodiskt och renderar output
|
||||
@@ -106,6 +111,29 @@ fn default_interval() -> u64 {
|
||||
10
|
||||
}
|
||||
|
||||
fn default_keybinds() -> Vec<KeybindConfig> {
|
||||
vec![
|
||||
KeybindConfig {
|
||||
key: "ctrl+space".to_string(),
|
||||
scope: KeybindScope::Global,
|
||||
action: MenuAction::SpawnRunDialog,
|
||||
label: Some("Öppna kommandodialog".to_string()),
|
||||
},
|
||||
KeybindConfig {
|
||||
key: "alt+enter".to_string(),
|
||||
scope: KeybindScope::Global,
|
||||
action: MenuAction::SpawnTerminal { shell: None },
|
||||
label: Some("Ny terminal".to_string()),
|
||||
},
|
||||
KeybindConfig {
|
||||
key: "ctrl+q".to_string(),
|
||||
scope: KeybindScope::Wm,
|
||||
action: MenuAction::Exit,
|
||||
label: Some("Avsluta TUI-WM".to_string()),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn load(path: &str) -> anyhow::Result<Config> {
|
||||
let content = fs::read_to_string(path)?;
|
||||
@@ -128,7 +156,10 @@ impl Config {
|
||||
Ok(c) => c,
|
||||
Err(e) => {
|
||||
eprintln!("Varning: kunde inte ladda {}: {}", path, e);
|
||||
Config::default()
|
||||
Config {
|
||||
keybinds: default_keybinds(),
|
||||
..Config::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user