make path variable

This commit is contained in:
Navid Sassan 2024-02-18 22:57:26 +01:00
parent 778d4e324f
commit cdeb040db0

View File

@ -152,6 +152,11 @@ fn handle_select() {
dbg!(&rofi_retv);
dbg!(&rofi_info);
let executable_path = env::current_exe().unwrap_or_else(|err| {
error!("Failed to get the path to the executable: {:?}", err);
process::exit(2);
});
match rofi_retv {
Err(_) => {
// this means rofi is not running yet, so let's start it
@ -160,7 +165,7 @@ fn handle_select() {
.arg("-show")
.arg("bw")
.arg("-modes")
.arg("bw:./target/debug/bw-menu select") // todo: set the path according to argv[0]
.arg(format!("bw:{} select", &executable_path.to_string_lossy()))
// we need to remap some default so that we can use the keys for custom binds
.arg("-kb-accept-alt")
.arg("F12")