mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 14:51:04 +02:00
Make launch_command more flexible with {app_name}
This commit is contained in:
parent
a6f63b3bf1
commit
d2f46a59b4
1 changed files with 3 additions and 3 deletions
|
@ -439,14 +439,14 @@ pub const fn default_true() -> bool {
|
|||
}
|
||||
|
||||
pub fn default_launch_command() -> String {
|
||||
String::from("gtk-launch")
|
||||
String::from("gtk-launch {app_name}")
|
||||
}
|
||||
|
||||
pub fn launch_command(file_name: &str, str: &str) {
|
||||
let launch_command_parts: Vec<&str> = str.split_whitespace().collect();
|
||||
let expanded = str.replace("{app_name}", file_name);
|
||||
let launch_command_parts: Vec<&str> = expanded.split_whitespace().collect();
|
||||
if let Err(err) = Command::new(&launch_command_parts[0])
|
||||
.args(&launch_command_parts[1..])
|
||||
.arg(file_name)
|
||||
.stdout(Stdio::null())
|
||||
.stderr(Stdio::null())
|
||||
.spawn()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue