Skip to content

Commit

Permalink
feat(bar): add flag to list system fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Sep 10, 2024
1 parent 7907dfe commit 96a9cb3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions komorebi-bar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::config::KomobarConfig;
use crate::config::Position;
use clap::Parser;
use eframe::egui::ViewportBuilder;
use font_loader::system_fonts;
use hotwatch::EventKind;
use hotwatch::Hotwatch;
use komorebi_client::SocketMessage;
Expand All @@ -34,6 +35,9 @@ struct Opts {
/// Print the JSON schema of the configuration file and exit
#[clap(long)]
schema: bool,
/// Print a list of fonts available on this system and exit
#[clap(long)]
fonts: bool,
/// Path to a JSON or YAML configuration file
#[clap(short, long)]
config: Option<PathBuf>,
Expand All @@ -57,6 +61,14 @@ fn main() -> color_eyre::Result<()> {
std::process::exit(0);
}

if opts.fonts {
for font in system_fonts::query_all() {
println!("{font}");
}

std::process::exit(0);
}

if std::env::var("RUST_LIB_BACKTRACE").is_err() {
std::env::set_var("RUST_LIB_BACKTRACE", "1");
}
Expand Down

0 comments on commit 96a9cb3

Please sign in to comment.