1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-16 14:21:03 +02:00

Make launch_command more flexible with {app_name}

This commit is contained in:
Username404-59 2025-06-22 16:45:17 +02:00
parent a6f63b3bf1
commit d2f46a59b4
No known key found for this signature in database
GPG key ID: F3A1878B14F5F0D7

View file

@ -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()