Skip to content

Commit d2017f2

Browse files
authored
Merge pull request #197 from fufexan/launch-prefix
Revert "plugins/applications: fix terminal apps with arguments"
2 parents b3b4f22 + 3c5b64e commit d2017f2

File tree

1 file changed

+7
-14
lines changed
  • plugins/applications/src

1 file changed

+7
-14
lines changed

plugins/applications/src/lib.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ mod scrubber;
3131

3232
const SENSIBLE_TERMINALS: &[&str] = &["alacritty", "foot", "kitty", "wezterm", "wterm"];
3333

34-
// remove arguments since they're not being used
35-
// https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html
36-
fn sanitize_exec(exec: &String) -> String {
37-
exec.replace("%U", "")
38-
.replace("%F", "")
39-
.replace("%u", "")
40-
.replace("%f", "")
41-
.replace(" ", "")
42-
}
43-
4434
#[handler]
4535
pub fn handler(selection: Match, state: &State) -> HandleResult {
4636
let entry = state
@@ -55,18 +45,21 @@ pub fn handler(selection: Match, state: &State) -> HandleResult {
5545
})
5646
.unwrap();
5747

58-
let exec = sanitize_exec(&entry.exec);
59-
6048
if entry.term {
6149
match &state.config.terminal {
6250
Some(term) => {
63-
if let Err(why) = Command::new(term).arg("-e").arg(&exec).spawn() {
51+
if let Err(why) = Command::new(term).arg("-e").arg(&entry.exec).spawn() {
6452
eprintln!("Error running desktop entry: {}", why);
6553
}
6654
}
6755
None => {
6856
for term in SENSIBLE_TERMINALS {
69-
if Command::new(term).arg("-e").arg(&exec).spawn().is_ok() {
57+
if Command::new(term)
58+
.arg("-e")
59+
.arg(&entry.exec)
60+
.spawn()
61+
.is_ok()
62+
{
7063
break;
7164
}
7265
}

0 commit comments

Comments
 (0)