| Summary: | krunner can't execute arbitrary linux commands or scripts | ||
|---|---|---|---|
| Product: | [Plasma] krunner | Reporter: | motoschifo <michele.fochi> |
| Component: | general | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | NEEDSINFO WAITINGFORINFO | ||
| Severity: | normal | CC: | alexander.lohnau, natalie_clarius, notmart |
| Priority: | NOR | ||
| Version First Reported In: | 6.5.4 | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
motoschifo
2026-01-08 17:22:45 UTC
can't reproduce, here any script in $PATH is used. how do you add /home/user/bin/ in your system? Here is an example from .bashrc file:
--- Code Start ---
export PATH="$PATH:~/bin"
--- Code End ---
The solution I found is to replace krunner with my own scripts.
Now I can launch:
- file manager with local folder
- file manager with volume folder
- any scripts/commands
This little script has no history or anything else: it execute my commands with no wait, no mouse selection, etc. and it can't introduce errors.
For example, in krunner I need to wait the GUI to refresh (if I press Enter the app is not displayed istantaneosly) and the top selected command is often invalid or not correct, because an app is installed new and the name came first.
I don't know if krunner will introduce this kind of changes, now I replaced META+R with my script. If anyone is interested, this is the command executed as script (the script is in my user folder, it's not globally installed):
sh /home/USER/bin/run.sh
--- Code Start ---
#!/bin/bash
# defaults
FILE_MANAGER="dolphin"
TERMINAL="bash -i -c"
#TERMINAL="konsole --noclose -e bash -c"
# Display the KDE input dialog box
CMD=$(/usr/bin/kdialog --title "Quick Run" --inputbox "Enter the command or a folder name:" "")
# Exit is the command is empty
if [ $? -ne 0 ] || [ -z "$CMD" ]; then
exit
fi
if [ -d "${CMD}" ]; then
# It's a volume folder
${FILE_MANAGER} "${CMD}" &
elif [ -d "${HOME}/${CMD}" ]; then
# it's a local user folder
${FILE_MANAGER} "${HOME}/${CMD}" &
else
# it's a script or application
${TERMINAL} "$CMD" &
fi
--- Code End ---
I hope this can be useful to improve krunner behaviour.
Remarks: I wrote that script to use on my system, it may contains errors, please double check it before using.
I wrote my first program using Qt6, instead of using the script this is exactly what I need on my setup. I don't know if krunner will introduce an option like "preselectFirstMatch", but until now I will continue to use my tool. Using a lot of shortcut and scripts, the time is crucial and I ofter digit 2-3 chars and then ENTER rapidly. If interested, I published the source code (very minimal) and maybe I will add configuration file support: https://github.com/motoschifo/qrun I continue to monitor this tread for updates. |