Skip to content

Commit

Permalink
feat: customize version number shown in cli & system tray
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Jul 10, 2024
1 parent b48e369 commit 0323e00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[env]
# Version number shown in CLI and system tray. Override this by setting the
# version number on build/run (i.e. `VERSION_NUMBER="1.0.0" cargo run`).
VERSION_NUMBER = "0.0.0"
4 changes: 3 additions & 1 deletion packages/wm/src/app_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ use crate::{
},
};

const VERSION: &'static str = env!("VERSION_NUMBER");

#[derive(Clone, Debug, Parser)]
#[clap(author, version, about, long_about = None)]
#[clap(author, version = VERSION, about, long_about = None)]
pub enum AppCommand {
/// Starts the window manager.
Start {
Expand Down
2 changes: 1 addition & 1 deletion packages/wm/src/sys_tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl SystemTray {
let icon = Icon::from_resource(IDI_ICON, None)?;
let _tray_icon = TrayIconBuilder::new()
.with_menu(Box::new(tray_menu))
.with_tooltip(format!("GlazeWM v{}", env!("CARGO_PKG_VERSION")))
.with_tooltip(format!("GlazeWM v{}", env!("VERSION_NUMBER")))
.with_icon(icon)
.build()?;

Expand Down

0 comments on commit 0323e00

Please sign in to comment.