I am trying to make the command flatpak run --command=gpu-screen-recorder com.dec05eba.gpu_screen_recorder -w screen -f 60 -r 30 -c mp4 -o /home/USER/Videos
of the GPU Screen Recorder program to make the program from a shortcut key to do a background replay of my screen without having to go to the program and do it manually.
The command in a terminal works without any problem but assigning the command to a shortcut in the KDE Plasma settings does absolutely nothing, maybe someone more experienced can help me.
P.S.: Is this community also intended for user comments, or is it an instance dedicated to official KDE releases?
Hey, I stumbled upon very similar issues while trying to setup custom screen layout reconfiguration using shortcuts and calling
kscreendoctor
. I see why they plan to improve that in future releases (6.0-ish I guess?).You can try to create a desktop file in
~/.local/share/applications
with the command, that would create a program launcher for desktop menus. You can then pick up your ‘application’ in the shortcut menu. That’s pretty disgusting way to do that, but I remember having more success this way for some reason.It is also a good idea to wrap long commands into one-line shell scripts.
You can try to create a desktop file in ~/.local/share/applications with the command, that would create a program launcher for desktop menus. You can then pick up your ‘application’ in the shortcut menu. That’s pretty disgusting way to do that, but I remember having more success this way for some reason.
Sounds like an interesting alternative, but what should be the name of the .desktop and what should be its content? Should the content be the typical .desktop filler or just the command I want to use?
The program as such already has a .desktop in /var/lib/flatpak/exports/share/applications and from the shortcuts settings in Plasma allows me to add shortcuts. but I can not add commands and even worse is that as such I can add commands to anything because there are no options.
You can add any number of desktop files and the name doesn’t really matter unless there’s the
.desktop
extension at the end. You can take any other desktop file as an example (on most systems you will have a lot of such files in/usr/share/applications
) or refer to specification. It could go like this:[Desktop Entry] Type=Application Name=GPU Recorder (background) Icon=media-record Exec=flatpak run --command=gpu-screen-recorder com.dec05eba.gpu_screen_recorder -w screen -f 60 -r 30 -c mp4 -o /home/USER/Videos Terminal=false Categories=AudioVideo;Audio;Video;
It should then appear in your application menu and you should be able to add it to shortcuts. I think if you want to bind more shortcuts, you can try with Actions https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html#extra-actions
though I think you shouldn’t be required to do any of theese and it should just take your any command and fire it on key press. I hope it’ll get fixed.
Work in absolute wonder, thank you very much for example and for the link, now I feel a little more hacker using Linux haha.