Skip to content

Commit 57e48b8

Browse files
committed
add bemenu
1 parent c76ebdf commit 57e48b8

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Power profile picker for window managers using D-Bus!
77
## Supported launchers
88

99
* [`dmenu`](https://tools.suckless.org/dmenu/)
10+
* [`bemenu`](https://github.com/Cloudef/bemenu)
1011
* [`rofi`](https://github.com/davatorium/rofi)
1112
* [`tofi`](https://github.com/philj56/tofi)
1213
* [`wofi`](https://github.com/SimplyCEO/wofi)

src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use powerprofile::PowerProfile;
1111
#[derive(FromArgs)]
1212
/// Power profile selector for power-profiles-daemon (or tlp-pd) using a dmenu-compatible launcher
1313
struct PPPArgs {
14-
/// launcher to use (supported launchers are fuzzel, dmenu, rofi, wofi, tofi)
14+
/// launcher to use (supported launchers are fuzzel, dmenu, bemenu, rofi, wofi, tofi)
1515
#[argh(option, short = 'l')]
1616
launcher: String,
1717

@@ -51,8 +51,8 @@ fn get_command(launcher: &str, current_profile: PowerProfile, custom_args: Optio
5151
.arg(&format!("Current profile: {}\n", current_profile.name()));
5252
cmd
5353
},
54-
_ => {
55-
let mut cmd = Command::new("dmenu");
54+
_ => { // dmenu/bemenu
55+
let mut cmd = Command::new(launcher);
5656
cmd.arg("-p")
5757
.arg(&format!("Current profile: {}", current_profile.name()));
5858
cmd
@@ -78,7 +78,7 @@ fn main() -> Result<()> {
7878

7979
let args: PPPArgs = argh::from_env();
8080

81-
let valid_launchers = ["fuzzel", "dmenu", "rofi", "wofi", "tofi"];
81+
let valid_launchers = ["fuzzel", "dmenu", "bemenu", "rofi", "wofi", "tofi"];
8282
if !valid_launchers.contains(&args.launcher.as_str()) {
8383
anyhow::bail!(
8484
"Invalid launcher '{}'. Must be one of: {}",
@@ -106,7 +106,7 @@ fn main() -> Result<()> {
106106
"fuzzel" | "rofi" => String::from_utf8(output.stdout)?
107107
.trim()
108108
.parse::<usize>()?,
109-
"dmenu" | "wofi" | "tofi" => { // for launchers that don't support indexing'
109+
"dmenu" | "bemenu" | "wofi" | "tofi" => { // for launchers that don't support indexing'
110110
let selected_entry = String::from_utf8(output.stdout)?
111111
.trim()
112112
.to_string();

0 commit comments

Comments
 (0)