Bug 440107

Summary: Custom Shortcuts failed to start commands with relative path and arguments
Product: [Applications] systemsettings Reporter: Murz <MurzNN>
Component: kcm_khotkeysAssignee: Michael Jansen <kde>
Status: RESOLVED DUPLICATE    
Severity: normal CC: kde, nate, plasma-bugs
Priority: NOR    
Version: 5.22.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

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 ***