KDE System Settings > Keyboard > Shortcuts > Commands not behaving as expected?

Issue

On my main system, I have a global keyboard shortcut configured in System Settings, executing the command firefox --private-window. This works as expected, and opens a new window in private browsing mode, while a different shortcut e.g. firefox --new-window opens a new window with the default profile and “normal“ mode.

So far so good. On a second system, running the same OS and KDE version, I installed the Firefox flatpak instead of the package. Running the command flatpak run firefox --private-window works as expected from konsole, however, configuring a shortcut in System Settings with the exact same command, does NOT behave as expected, and instead opens up a normal new Firefox window, instead of one in private browsing mode.

I already tried deleting the shortcut, reopening System Settings and creating it again, but to no avail. flatpak run firefox --private-window keeps working as expected from the terminal, but not when executed through whatever executes commands configured in System Settings > Keyboard > Shortcuts > Commands.

I can work around this issue by creating a .desktop file and assigning it the same intended shortcut, but that clutters the menu with an unnecessary entry and I still can not explain the observed behavior.

Does anyone here have an idea or straight up knows why the execution of flatpak commands seemingly gets it’s arguments stripped when invoked through system keyboard shortcuts in the keyboard section?

System Information

main system

Operating System: Nobara Linux 42
KDE Plasma Version: 6.5.2
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.3
Kernel Version: 6.17.7-200.nobara.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 32 GiB of RAM (31,3 GiB usable)
Graphics Processor: AMD Radeon RX 7800 XT

second system with the issue

Operating System: Nobara Linux 42
KDE Plasma Version: 6.5.2
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.3
Kernel Version: 6.17.7-200.nobara.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-10510U CPU @ 1.80GHz
Memory: 16 GiB of RAM (15,3 GiB usable)
Graphics Processor: Intel® UHD Graphics

You can hide the desktop file with NoDisplay=true

please file a bug for the issue though.

Thank you for your suggestions. I reported the behavior as requested.


In case someone else comes across this issue specifically for flatpaks, I figured out what is probably the intended way to do this:

The default .desktop file for Firefox’s flatpak comes with pre-configured actions: Launch, New Private Window, New Window and Open Profile Manager. To create a global keyboard shortcut for these via System Settings:

  1. in System Settings > Keyboard > Shortcuts > Add New > Application ... select Firefox
  2. Firefox should now show up in System Settings > Keyboard > Shortcuts > Applications
  3. select Firefox from the Application list
  4. configure a shortcut for the desired action in the menu on the right-hand side

For other flatpaks, in case they miss the desired actions, one can probably just create them oneself, by following Application Actions sections of the Desktop Entry Spec and adjust a copy of the default Exec value with the desired adjusted command.


Since I found a clean solution for my immediate use-case, and I raised a bug for the observed behavior which seems unintended, I’ll close this thread as solved.