mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-19 07:19:50 +02:00
feat(bar): add flag to list system fonts
This commit is contained in:
@@ -15,6 +15,7 @@ use crate::config::KomobarConfig;
|
|||||||
use crate::config::Position;
|
use crate::config::Position;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use eframe::egui::ViewportBuilder;
|
use eframe::egui::ViewportBuilder;
|
||||||
|
use font_loader::system_fonts;
|
||||||
use hotwatch::EventKind;
|
use hotwatch::EventKind;
|
||||||
use hotwatch::Hotwatch;
|
use hotwatch::Hotwatch;
|
||||||
use komorebi_client::SocketMessage;
|
use komorebi_client::SocketMessage;
|
||||||
@@ -34,6 +35,9 @@ struct Opts {
|
|||||||
/// Print the JSON schema of the configuration file and exit
|
/// Print the JSON schema of the configuration file and exit
|
||||||
#[clap(long)]
|
#[clap(long)]
|
||||||
schema: bool,
|
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
|
/// Path to a JSON or YAML configuration file
|
||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
config: Option<PathBuf>,
|
config: Option<PathBuf>,
|
||||||
@@ -57,6 +61,14 @@ fn main() -> color_eyre::Result<()> {
|
|||||||
std::process::exit(0);
|
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() {
|
if std::env::var("RUST_LIB_BACKTRACE").is_err() {
|
||||||
std::env::set_var("RUST_LIB_BACKTRACE", "1");
|
std::env::set_var("RUST_LIB_BACKTRACE", "1");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user