If you work with many types of graphics files each day, you probably also use different graphics apps to open and edit them. And you’re probably wasting a lot of time without even realizing it. Theoretically, you can select multiple files, right-click on them and select the program you want from the “Open with” option in the context menu. This doesn’t work every time, as the application you want to use doesn’t always show up as the “default” programs.
If you’re using a customizable file manager like SpaceFM, you can add a menu to its toolbar that allows you to quickly open multiple files with the application you want in a single click.
Although we focus on graphics, that doesn’t mean you’re limited to this type of application. You can follow the steps below, but for example, replace the graphics software with your favorite media players, creating a menu that will allow you to open your favorite video files in different ways.
If it is not already available, find and install SpaceFM in your Linux distribution through its app store/software center. If you are using a Debian / Ubuntu-based distribution, you can install it with the command:
sudo apt-get install spacefm
Once installed, SpaceFM will be accessible from the main Application menu. Run it and resize its window so that you can see the full contents of its main toolbar.
Add a new submenu
1. Right-click an empty spot on its toolbar and select from the popup menu that appears in the “New -> Submenu” entry. This will allow you to add a menu to the toolbar where you’ll group your primary graphics apps.
2. Continue by giving a name to your menu in the window that appears. We are using “Graphics” in this case.
3. SpaceFM doesn’t like empty menus. Thus, it will have already placed a “blank” command in the menu you just created. Select it to display a window through which you will be able to modify it.
4. Enter a name for your command in the almost identical window that appears. Since our goal is to be able to easily open one or more graphics files with an application we choose in a single move, each command will “map” to a single application. It would probably be best if you just used the name of each application as the button’s/command’s name. For our first command, we used the name “Inkscape.”
5. The following window shows a similar edit space where you can structure your command but also a handy list of codes. You can splice those codes in any typical BASH command (you enter in the edit space) to “feed” to it any selected files and folders.
Usually, when you want “to open files with applications that support doing that with a command” (that happens to be the majority of apps in Linux land), what you need are just the first three shortcodes. Most of your “commands” will consist of the application’s name followed by either “%F,” “%f” (notice it’s lowercase) or “%d.”
The first one,
%F, acts on all selected files (if the app supports batch-loading). Use
%f to act on a single file (works with most apps that support opening files).
%d corresponds to the active directory (rare but useful when, for example, mass-converting files between formats).
Since we want to be able to open all selected files in Inkscape for this first button of ours, we structured the command as:
This command translates to “inkscape selected-file-1 selected-file-2” etc. With this option, all the selected files will open in the specified application – in this case, inkscape.
6. Each new entry in the SpaceFM toolbar uses the same default icon. If you add only one button or submenu, you will have no problem recognizing it. For more than one, it is better to set a different icon for each entry, making them easier to identify at a glance.
For this, go to the “Menu Item” tab. You can click on the Choose button to see a list of all the icons the app has recognized as available. As there are a ton of icons in the list, it is best to directly type the name of an application into the entry field next to “Icon:”
In our case, before we even finished typing “Inkscape,” its icon had already been detected and displayed on the Choose button. This button also acts as a preview, with any chosen icon presented “on top” of it, as it will be in the final button/menu.
Repeat the previous steps to add more commands to your menu, matching them to your favorite applications. Soon you will have a menu like the one you see in our picture, allowing instant opening of any selected file(s) or folder(s) in your app of choice with a single click.
Our latest tutorials delivered straight to your inbox