small changes to config/cli
This commit is contained in:
parent
5fe9ef131b
commit
5a8f4a0c64
|
|
@ -1,14 +1,15 @@
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
/// Program which finds the active mpris player.
|
/// Program which finds the active mpris player and displays metadata about the playing piece of media.
|
||||||
///
|
///
|
||||||
/// Most configuration is done through config files.
|
/// This program is intended to be used with polybar.
|
||||||
|
/// as such, most configuration is done through config files.
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
pub struct Cli {
|
pub struct Cli {
|
||||||
/// The name of the config file to use.
|
/// The name of the config file to use.
|
||||||
#[arg(short = 'c', long = "config", default_value = "default")]
|
#[arg(short = 'c', long = "config", default_value = "default")]
|
||||||
pub config_file: String,
|
pub config_file: String,
|
||||||
/// Enable debug mod.
|
/// Enable debug mode.
|
||||||
///
|
///
|
||||||
/// This mode prints all active players to stdout, to allow one to find the appropriate player names to use in the config files.
|
/// This mode prints all active players to stdout, to allow one to find the appropriate player names to use in the config files.
|
||||||
#[arg(short = 'd', long = "debug")]
|
#[arg(short = 'd', long = "debug")]
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,12 @@ impl Default for Rating {
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub metadata_separator: String,
|
|
||||||
pub array_separator: char,
|
|
||||||
pub update_delay: u64,
|
|
||||||
pub hide_output: bool,
|
pub hide_output: bool,
|
||||||
pub fuzzy: bool,
|
pub fuzzy: bool,
|
||||||
pub render_prefix: bool,
|
pub render_prefix: bool,
|
||||||
|
pub update_delay: u64,
|
||||||
|
pub metadata_separator: String,
|
||||||
|
pub array_separator: char,
|
||||||
pub break_character: Option<char>,
|
pub break_character: Option<char>,
|
||||||
pub player_priorities: Vec<String>,
|
pub player_priorities: Vec<String>,
|
||||||
pub rating_icons: Option<Rating>,
|
pub rating_icons: Option<Rating>,
|
||||||
|
|
@ -63,16 +63,16 @@ pub struct Config {
|
||||||
impl Default for Config {
|
impl Default for Config {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Config {
|
Config {
|
||||||
update_delay: 300_u64,
|
|
||||||
metadata_separator: "|".to_owned(),
|
|
||||||
array_separator: '+',
|
|
||||||
hide_output: true,
|
hide_output: true,
|
||||||
fuzzy: false,
|
fuzzy: false,
|
||||||
render_prefix: true,
|
render_prefix: true,
|
||||||
metadata_fields: Config::default_metadata_fields(),
|
update_delay: 300_u64,
|
||||||
rating_icons: Some(Rating::default()),
|
metadata_separator: " | ".to_owned(),
|
||||||
player_priorities: Config::default_player_priorities(),
|
array_separator: '+',
|
||||||
break_character: Some('-'),
|
break_character: Some('-'),
|
||||||
|
player_priorities: Config::default_player_priorities(),
|
||||||
|
rating_icons: Some(Rating::default()),
|
||||||
|
metadata_fields: Config::default_metadata_fields(),
|
||||||
player_prefixes: Config::default_player_prefixes(),
|
player_prefixes: Config::default_player_prefixes(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -108,10 +108,13 @@ impl Config {
|
||||||
fn default_player_prefixes() -> HashMap<String, char> {
|
fn default_player_prefixes() -> HashMap<String, char> {
|
||||||
let mut out: HashMap<String, char> = HashMap::new();
|
let mut out: HashMap<String, char> = HashMap::new();
|
||||||
|
|
||||||
|
out.insert("chromium".to_owned(), 'g');
|
||||||
out.insert("Clementine".to_owned(), 'c');
|
out.insert("Clementine".to_owned(), 'c');
|
||||||
out.insert("Firefox".to_owned(), 'f');
|
|
||||||
out.insert("Spotify".to_owned(), 's');
|
|
||||||
out.insert("default".to_owned(), '>');
|
out.insert("default".to_owned(), '>');
|
||||||
|
out.insert("Firefox".to_owned(), 'f');
|
||||||
|
out.insert("mpv".to_owned(), 'm');
|
||||||
|
out.insert("Spotify".to_owned(), 's');
|
||||||
|
out.insert("VLC Media Player".to_owned(), 'v');
|
||||||
|
|
||||||
out
|
out
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue