-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
186 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/target | ||
.fleet | ||
.idea | ||
flamegraph.svg | ||
perf.data | ||
perf.data.old | ||
perf.data.old |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ use std::sync::Mutex; | |
|
||
use anyhow::anyhow; | ||
use clap::Parser; | ||
use once_cell::sync::Lazy; | ||
use once_cell::sync::{Lazy, OnceCell}; | ||
use tracing::{debug, info}; | ||
use tracing_subscriber::layer::SubscriberExt; | ||
use tracing_subscriber::util::SubscriberInitExt; | ||
|
@@ -25,10 +25,12 @@ pub static THEME_PATH: Lazy<Mutex<PathBuf>> = Lazy::new(|| { | |
) | ||
}); | ||
|
||
static THEME_SCALE: OnceCell<f32> = OnceCell::new(); | ||
|
||
pub static THEME: Lazy<Theme> = Lazy::new(Theme::load); | ||
|
||
#[derive(Parser)] | ||
#[structopt(name = "onagre", author = "Paul D. <[email protected]>")] | ||
#[command(name = "onagre", author = "Paul D. <[email protected]>")] | ||
struct Cli { | ||
#[arg( | ||
long = "theme", | ||
|
@@ -37,6 +39,9 @@ struct Cli { | |
)] | ||
theme: Option<PathBuf>, | ||
|
||
#[arg(long = "scale", short = 's', help = "Change the scale of onagre theme")] | ||
scale: Option<f32>, | ||
|
||
#[arg(long = "mode", short = 'm', help = "The mode parameter as a string")] | ||
mode: Option<String>, | ||
} | ||
|
@@ -51,6 +56,7 @@ pub fn main() -> iced::Result { | |
|
||
info!("Starting onagre"); | ||
let cli = Cli::parse(); | ||
|
||
// User defined theme config, $XDG_CONFIG_DIR/onagre/theme.toml otherwise | ||
if let Some(theme_path) = cli.theme { | ||
let path = theme_path.canonicalize(); | ||
|
@@ -61,6 +67,11 @@ pub fn main() -> iced::Result { | |
info!("Using alternate theme : {:?}", THEME_PATH.lock().unwrap()); | ||
} | ||
|
||
if let Some(scale) = cli.scale { | ||
THEME_SCALE.get_or_init(|| scale); | ||
info!("Using scale value : {:?}", scale); | ||
} | ||
|
||
if let Some(mode) = cli.mode { | ||
debug!("Mode parameter: {:?}", mode); | ||
|
||
|