diff --git a/README.md b/README.md index a366c40..580740b 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ | [Fuzzel](https://codeberg.org/dnkl/fuzzel) | ✅ | ✅ | XDG icons supported since v1.13.0 | | [Rofi](https://github.com/davatorium/rofi) | ✅ | 🔄 | XDG icon support pending via [PR #2122](https://github.com/davatorium/rofi/pull/2122) | | [dmenu](https://tools.suckless.org/dmenu) | ✅ | ❌ | No XDG icon support | +| [bemenu](https://github.com/Cloudef/bemenu)| ✅ | ❌ | No XDG icon support | | Custom (stdin) | ✅ | ❔ | Depends on launcher implementation | > [!TIP] @@ -162,13 +163,13 @@ iwmenu -l custom --launcher-command "fuzzel -d --placeholder '{hint}' {password_ ### Available Options -| Flag | Description | Supported Values | Default Value | -| -------------------- | --------------------------------------------------------- | ----------------------------------- | ------------- | -| `-l`, `--launcher` | Specify the launcher to use (**required**). | `dmenu`, `rofi`, `fuzzel`, `custom` | `None` | -| `--launcher-command` | Specify the command to use when `custom` launcher is set. | Any valid shell command | `None` | -| `-i`, `--icon` | Specify the icon type to use. | `font`, `xdg` | `font` | -| `-s`, `--spaces` | Specify icon to text space count (font icons only). | Any positive integer | `1` | -| `--back-on-escape` | Return to previous menu on escape. | N/A | `false` | +| Flag | Description | Supported Values | Default Value | +| -------------------- | --------------------------------------------------------- | --------------------------------------------- | ------------- | +| `-l`, `--launcher` | Specify the launcher to use (**required**). | `dmenu`, `rofi`, `fuzzel`, `bemenu`, `custom` | `None` | +| `--launcher-command` | Specify the command to use when `custom` launcher is set. | Any valid shell command | `None` | +| `-i`, `--icon` | Specify the icon type to use. | `font`, `xdg` | `font` | +| `-s`, `--spaces` | Specify icon to text space count (font icons only). | Any positive integer | `1` | +| `--back-on-escape` | Return to previous menu on escape. | N/A | `false` | ## Contributing diff --git a/src/launcher.rs b/src/launcher.rs index 2812e27..56c89d5 100644 --- a/src/launcher.rs +++ b/src/launcher.rs @@ -22,6 +22,7 @@ pub enum LauncherType { Fuzzel, Rofi, Dmenu, + Bemenu, Custom, } @@ -40,6 +41,10 @@ pub enum LauncherCommand { Dmenu { prompt: Option, }, + Bemenu { + prompt: Option, + password_mode: bool, + }, Custom { program: String, args: Vec, @@ -98,6 +103,19 @@ impl Launcher { } cmd } + LauncherCommand::Bemenu { + prompt, + password_mode, + } => { + let mut cmd = Command::new("bemenu"); + if let Some(hint_text) = prompt { + cmd.arg("-p").arg(format!("{hint_text}: ")); + } + if password_mode { + cmd.arg("--password").arg("indicator"); + } + cmd + } LauncherCommand::Custom { program, args } => { let mut cmd = Command::new(&program); cmd.args(&args); @@ -253,6 +271,10 @@ impl Launcher { password_mode, }), LauncherType::Dmenu => Ok(LauncherCommand::Dmenu { prompt: hint_text }), + LauncherType::Bemenu => Ok(LauncherCommand::Bemenu { + prompt: hint_text, + password_mode, + }), LauncherType::Custom => { if let Some(cmd) = command_str { let processed_cmd = Self::substitute_placeholders(cmd, hint, password_mode)?;