feat(cli): add datadir cmd

Because I'm tired of trying to find this stupid directory in
explorer.exe all the time.
This commit is contained in:
LGUG2Z
2025-04-02 17:20:33 -07:00
parent 76aeefa9f7
commit 71762a5961
4 changed files with 24 additions and 2 deletions

View File

@@ -978,6 +978,9 @@ enum SubCommand {
/// Show the path to whkdrc
#[clap(alias = "whkd")]
Whkdrc,
/// Show the path to komorebi's data directory in %LOCALAPPDATA%
#[clap(alias = "datadir")]
DataDirectory,
/// Show a JSON representation of the current window manager state
State,
/// Show a JSON representation of the current global state
@@ -1754,6 +1757,12 @@ fn main() -> Result<()> {
println!("{}", whkdrc.display());
}
}
SubCommand::DataDirectory => {
let dir = &*DATA_DIR;
if dir.exists() {
println!("{}", dir.display());
}
}
SubCommand::Log => {
let timestamp = Utc::now().format("%Y-%m-%d").to_string();
let color_log = std::env::temp_dir().join(format!("komorebi.log.{timestamp}"));