Bug 514090

Summary: Setting multiple hotkeys for the same script with different arguments doesn't work but GUI shows as if it did.
Product: [Frameworks and Libraries] frameworks-kglobalaccel Reporter: stoppi.felix
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: fanzhuyifan, kde
Priority: NOR    
Version First Reported In: 6.21.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description stoppi.felix 2026-01-02 21:40:26 UTC
SUMMARY
Adding a script in hotkeys and setting a hotkey for it works. Adding the same script with different arguments and setting a hotkey displays correctly, but the hotkey is never set/reassigned.

STEPS TO REPRODUCE
1.  Create a simple executable script that acts differently depending on arguments passed. Example:

#!/bin/bash
$1 &

2. Go to Settings, Hotkeys, Add New, add your script  with an argument. Example:
    ~/.local/bin/example.sh kate
3. Add a hotkey to the script and Apply. This works, pressing the hotkey opens Kate.
4. Add New, add your script again, with a different arguement. Example:
    ~/.local/bin/example.sh konsole
5. Add a hotkey to the second script and Apply.

OBSERVED RESULT
If you add a new hotkey to the second script, it does nothing, as the hotkey was never really assigned, despite the GUI displaying the hotkey as set.
Using an already assigned hotkey, eg. Meta+E will give you the "do you really want to reassign" prompt. Pressing OK will remove the hotkey from it's previous location and add it to your script (visually).
The hotkey is in reality still bound to the old function, so Meta+E will still open dolphin for example.

EXPECTED RESULT
The hotkey is actually assigned to the script, as the GUI would lead you to believe.

WORKAROUND
Use different scripts instead of the same script with arguments

SOFTWARE/OS VERSIONS
Linux: 6.17.9-zen1-1-zen (64-bit)
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: qt6-base 6.10.1
kglobalaccel: 6.21.0