about summary refs log tree commit diff stats
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/by-name/ri/river-mk-keymap/contrib/init.json5
-rw-r--r--pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs10
2 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/by-name/ri/river-mk-keymap/contrib/init.json b/pkgs/by-name/ri/river-mk-keymap/contrib/init.json
index 7faaeb43..a5f24307 100644
--- a/pkgs/by-name/ri/river-mk-keymap/contrib/init.json
+++ b/pkgs/by-name/ri/river-mk-keymap/contrib/init.json
@@ -113,10 +113,13 @@
       ]
     },
     "m": {
-      "l": [
+      "l": {
+        "command": [
         "spawn",
         "/nix/store/7h9w2sycqj3i2lp61nibgv7qhvwy3pi9-wireplumber-0.5.10/bin/wpctl set-volume @DEFAULT_SINK@ 5%-"
       ],
+        "description": "wpctl set-volume @DEFAULT_SINK@ 5%-"
+    },
       "m": [
         "spawn",
         "/nix/store/08bgv5x7gfhkczf0lgrpim1rw51jlxvn-mpp/bin/mpp toggle"
diff --git a/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs b/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs
index 60ed41b8..5c89c2e2 100644
--- a/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs
+++ b/pkgs/by-name/ri/river-mk-keymap/src/key_map/mod.rs
@@ -29,6 +29,9 @@ pub struct KeyConfig {
     /// Whether to allow this key mapping in the “locked” mode.
     #[serde(default)]
     allow_locked: bool,
+
+    /// Use a different description to display this command, instead of the `command`.
+    description: Option<String>,
 }
 
 impl FromStr for KeyMap {
@@ -48,6 +51,7 @@ impl FromStr for KeyMap {
                         .collect::<Option<_>>()
                         .ok_or(anyhow!("A array contained a non-string value: {value:#?}"))?,
                     allow_locked: false,
+                    description: None,
                 }
             } else if let Some(object) = value.as_object() {
                 if object.contains_key("command") {
@@ -100,7 +104,11 @@ impl FromStr for KeyMap {
 }
 impl Display for KeyConfig {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
-        f.write_str(self.command.join(" ").as_str())
+        if let Some(desc) = &self.description {
+            f.write_str(desc)
+        } else {
+            f.write_str(self.command.join(" ").as_str())
+        }
     }
 }