mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-25 01:58:51 +02:00
feat(cli): add config command
This commit adds the "komorebic config" command as a helper to print the path to komorebi.json, while respecting the KOMOREBI_CONFIG_HOME environment variable if it exists. This is particularly useful for users who wish to edit this file on the command line, as they can now run commands like: "lvim $(komorebic config)"
This commit is contained in:
@@ -805,8 +805,10 @@ enum SubCommand {
|
|||||||
Start(Start),
|
Start(Start),
|
||||||
/// Stop the komorebi.exe process and restore all hidden windows
|
/// Stop the komorebi.exe process and restore all hidden windows
|
||||||
Stop(Stop),
|
Stop(Stop),
|
||||||
/// Output various important komorebi-related environment values
|
/// Check komorebi configuration and related files for common errors
|
||||||
Check,
|
Check,
|
||||||
|
/// Show the path to komorebi.json
|
||||||
|
Config,
|
||||||
/// Show a JSON representation of the current window manager state
|
/// Show a JSON representation of the current window manager state
|
||||||
State,
|
State,
|
||||||
/// Show a JSON representation of visible windows
|
/// Show a JSON representation of visible windows
|
||||||
@@ -1414,6 +1416,14 @@ fn main() -> Result<()> {
|
|||||||
println!("If running 'komorebic start --await-configuration', you will manually have to call the following command to begin tiling: komorebic complete-configuration\n");
|
println!("If running 'komorebic start --await-configuration', you will manually have to call the following command to begin tiling: komorebic complete-configuration\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SubCommand::Config => {
|
||||||
|
let static_config = HOME_DIR.join("komorebi.json");
|
||||||
|
|
||||||
|
if static_config.exists() {
|
||||||
|
println!("{}", static_config.display());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SubCommand::AhkLibrary => {
|
SubCommand::AhkLibrary => {
|
||||||
let library = HOME_DIR.join("komorebic.lib.ahk");
|
let library = HOME_DIR.join("komorebic.lib.ahk");
|
||||||
let mut file = OpenOptions::new()
|
let mut file = OpenOptions::new()
|
||||||
|
|||||||
Reference in New Issue
Block a user