@@ -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
1313struct 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