Bug 440107 - Custom Shortcuts failed to start commands with relative path and arguments
Summary: Custom Shortcuts failed to start commands with relative path and arguments
Status: RESOLVED DUPLICATE of bug 440507
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_khotkeys (show other bugs)
Version: 5.22.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Jansen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-21 10:38 UTC by Murz
Modified: 2021-08-04 19:33 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Murz 2021-07-21 10:38:46 UTC
SUMMARY
When I configuring action to run command in KDE Custom Shortcuts interface with relative path, starting from $HOME and with arguments - it fails to start. With absolute path OR without arguments - all works well!

STEPS TO REPRODUCE
1. Create some executable test file in home folder, eg `~/bin/test-cmd.sh` with contents:
```
#!/bin/bash

kdialog --msgbox "Launched with arg 1: $1!"
```

2. In KDE Custom Shortcuts settings create a new global shortcut with command "/home/USERNAME/bin/test-cmd.sh my-arg1"
Test that it works successfully.

3. Replace command path to relative: "~/bin/test-cmd.sh my-arg1" and launch again.
You will see the error message:
```
Unable to run the command specified. The file or folder /home/USERNAME/bin/test-cmd.sh my-arg1 does not exist.
```

4. Remove argument from command text "~/bin/test-cmd.sh" and launch again - it will executed successfully!

EXPECTED RESULT
Command with relative path and arguments should be launched successfully, like with full path.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 21.04
KDE Plasma Version: 5.22.3
KDE Frameworks Version: 5.84.0
Qt Version: 5.15.2
Kernel Version: 5.11.0-25-generic (64-bit)
Graphics Platform: X11
Comment 1 Nate Graham 2021-08-04 19:33:17 UTC

*** This bug has been marked as a duplicate of bug 440507 ***