If you are new to Zorin/Linux and you like to launch your apps with keyboard shortcuts, you may be puzzling like I was over how to assign a keyboard shortcut to launch your Flatpak apps.
Sure, you could just find your Flatpak in the Menu, right click it and Add to Dash, then use Super + Number to launch it. But for the sake of this tutorial I will assume that you would like an alternative way of launching your Flatpak app from the keyboard.
Note: I am on Zorin Core 17.2 with standard GNOME desktop and Xorg.
Step One
First, we need to know the Application ID of the Flatpak we want to assign a shortcut to. Open Terminal by holding CTRL ALT T and run this simple command
flatpak list --app
Terminal will return a list of Flatpaks installed on your system. Find the app you want to create a keyboard shortcut for and highlight the Application ID. This will copy it to your clipboard. (Or highlight it and hold CTRL SHIFT C if using a mouse with no middle/wheel).
If you would like to test that this app will open with the command used in this tutorial for making Flatpak shortcuts, hold ALT F2 to bring up the command window.
Type this simple command
flatpak run
with a space at the end, then click with your mouse middle/wheel to paste the Application ID saved on your clipboard to finish the command (or hold CTRL SHIFT V if using a mouse with no middle/wheel). Now press Enter. If it is your first time opening the app, be patient, it may take even up to 10 seconds.
Ok if our app opens successfully we know the next step will work! We can close the app and close terminal.
Step Two
Now lets open the menu and select Settings.
Search for keyboard - you will probably only have to type k to bring it up. Select Keyboard from the results and scroll to the bottom where you will find View and Customize Shortcuts.
Select View and Customize Shortcuts and scroll to the bottom of the next menu, where you will find Custom Shortcuts. Click that.
If this is the first custom shortcut you're adding, you will see an Add Shortcut button. If you have created other shortcuts, you will see a button with a + sign. Click either of these to begin creating the shortcut to launch your Flatpak.
Step Three
In the pane that appears, choose a name for your shortcut. This should be different than the app name.
In the Command field, type
flatpak run
with a space at the end, then click with your mouse middle/wheel to paste the Application ID that is saved on your clipboard (or hold CTRL SHIFT V if using a mouse with no middle/wheel).
Next click Set Shortcut. This will bring up a pane where we can choose the keys we would like to use for our shortcut. Here you can see a warning if you choose a shortcut that is already in use.
When you find a shortcut combination you are happy with, click Add. I like to use Super on shortcuts that launch things.
Done!
There you go. Now exit out of settings and try out your new shortcut!
Note: I am appending a new tip I learned here. If your mouse does not have a middle/wheel, you can represent a middle click by clicking the left and right mouse buttons at the same time.