[Gnome3] The Keyboard Shortcut guide & dealing with Flatpaks & Terminal apps

Make things easier by adding shortcuts. Gnome3 has shortcut hidden away in the Control Panel.

Settings>Devices>Keyboard Shortcuts
Screenshot_2020-02-08_04-12-08

Now, there are some shortcuts already set up for us like Launchers, System, Navigation, Screenshots, Sounds and Media. Some of the “Launchers” were already disabled for me, so I just went ahead and set those up first.

Simply click on the one you need to change ex: “Launch web browser” brings up the set shortcut mode.

and I click the keys I want to set up.

But I have a different problem… Flatpaks

I have some applications I have installed via Flatpaks from flathub, so I’ll need to set up some shortcuts for that. Flatpaks have their .desktop files nested pretty deep in the system so I had to do some digging. I will use the .desktop file to find out what command needs to be executed to start the flatpak application.

I’m on Fedora 31 and found my flatpak .desktop files in /var/lib/flatpak/exports/share/applications

Open the terminal and cd /var/lib/flatpak/exports/share/applications and then

look for your flatpak .desktop file. You can use the terminal to grep what you need ex:

ls | grep -i spotify

which returns : com.spotify.Client.desktop

now we need to find the Exec= command from this file, type:

grep -i Exec= com.spotify.Client.desktop

which will grep the file for the Exec= and return the command we need to place in the “Add Custom Shortcuts” prompt from Keyboard Settings. It looks like this :

Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client @@u %U @@

All we need is everything after Exec= so copy that. Now that we have that we can set up the shortcut!

Go to back to Settings>Devices>Keyboard Shortcuts scroll down to the bottom and click + which will open up the prompt. Start by naming it what you like, then pasting the command above and finally clicking Set Shortcut button:

Screenshot_2020-02-08_04-17-42

Screenshot_2020-02-08_04-18-01

And that is it ! You have your flatpak shortcut set up!

You can do this with all your applications. I have a system where I have Super+1, Super+2 and other set up for my most used programs.

I’ll make another post where I show how to set up vim as a shortcut as well.
Also, I go through a quick review of managing your windows and other applications.

2 Likes