diff --git a/cliff.toml b/cliff.toml index b0f88b2..19d10d2 100644 --- a/cliff.toml +++ b/cliff.toml @@ -19,7 +19,7 @@ body = """ {% else %}\ ## [unreleased] {% endif %}\ -{% for group, commits in commits | group_by(attribute="group") %} +{% for group, commits in commits | filter(attribute="merge_commit", value=false) | group_by(attribute="group") %} ### {{ group | striptags | trim | upper_first }} {% for commit in commits %} - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ diff --git a/src/args.rs b/src/args.rs index 7c5868e..f2f1eb3 100644 --- a/src/args.rs +++ b/src/args.rs @@ -36,4 +36,6 @@ pub struct Args { pub selection: Option, #[clap(short, long, help = "The style of the vault name")] pub name: Option, + #[clap(short, long, help = "The icon to display for each entry")] + pub icon: Option, } diff --git a/src/config.rs b/src/config.rs index e77a887..f09c0a3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -19,6 +19,8 @@ pub enum DisplayName { pub struct Config { pub display_name: DisplayName, pub source: Source, + #[serde(default = "default_icon")] + pub icon: String, } #[derive(Serialize, Deserialize, Debug)] @@ -50,6 +52,10 @@ impl Config { } } +fn default_icon() -> String { + "obsidian".to_string() +} + impl Default for Source { fn default() -> Self { Self { diff --git a/src/main.rs b/src/main.rs index ade08e2..c78a1d0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,6 +84,7 @@ fn get_known_vaults(conf: &Config) -> Vec { fn rofi_main(state: u8, conf: Config, args: Args) -> Result<()> { let rofi_info: String = env::var("ROFI_INFO").unwrap_or_default(); let name_style = args.name.unwrap_or(conf.display_name.clone()); + let icon = args.icon.unwrap_or(conf.icon.clone()); match state { // Prompting which vault to open @@ -107,7 +108,7 @@ fn rofi_main(state: u8, conf: Config, args: Args) -> Result<()> { DisplayName::Unique => unique_names.get(i).unwrap(), }; - println!("{name}\0info\x1f{vault}"); + println!("{name}\0icon\x1f{icon}\x1finfo\x1f{vault}"); }); } // Opening the selected vault