How to Easily Open Multiple Files with SpaceFM in Linux

If you use multiple types of graphics files every day, you may also use different graphics applications to open and edit them. And you may waste a lot of time without even realizing it. Theoretically, you can select multiple files, right-click them, and select the desired program from the “Open With” option of the context menu. This does not work every time, because the application you want to use does not always appear as the “default” program.

If you are using a customizable file manager (such as SpaceFM), you can add menus to its toolbar, allowing you to quickly open multiple files with the application you want with one click.

Although we focus on graphics, this does not mean that you are limited to this type of application. You can follow the steps below, but, for example, replace your graphics software with your favorite media player and create a menu that will allow you to open your favorite video files in different ways.


If it is not yet 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 using the following command:

sudo apt-get install spacefm

After installation is complete, you can access SpaceFM from the Applications main menu. Run it and resize its window so that you can see the entire contents of its main toolbar.

Add a new submenu

1. Right-click an empty space on its toolbar and select from the pop-up menu that appears in the “New-> Submenu” entry. This way, you can add menus to the toolbar to group your main graphics applications.

Spacefm graphics menu new blank menu

2. Name the menu in the window that appears to continue. In this case, we use “graphics”.

Spacefm graphics menu names

3. SpaceFM doesn’t like empty menus. So it will place a “blank” command in the menu you just created. Select it to display a window that you can modify.

Spacefm graphics menu clear command

4. Enter the name of the command in the almost identical window that appears. Since our goal is to be able to easily open one or more graphics files with the application we selected in one step, each command will be “mapped” to a single application. It might be best if you only use the name of each application as the name of the button / command. For the first command, we use the name “Inkscape”.

Spacefm graphics menu commands

5. The following window shows a similar editing space where you can build commands, but you can also easily get a code listing. You can stitch this code in any typical BASH command (entered in the editing space) to “feed” any selected files and folders into it.

Generally, when you want to “open a file with an application that supports this using commands” (which happens to be most applications in the Linux realm), all you need is the first three shortcodes. Most of your “commands” will consist of the name of the application, followed by “% F”, “% f” (note lowercase) or “% d”.

Spacefm graphics menu code

First, %F, Works on all selected files (if the application supports bulk loading). Adopt %f Can perform operations on individual files (used with most apps that support opening files). %d Corresponds to Active Directory (rare, but useful for batch conversion between formats, for example).

Since we want to be able to open all selected files for our first button in Inkscape, we will structure the command as follows:

inkscape %F

This command translates to “inkscape selected-file-1 selected-file-2” and so on. With this option, all selected files will be opened 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, there is no problem identifying it. For more than one object, it is best to set a different icon for each entry so that they can be identified at a glance.

To do this, go to the Menu Items tab. You can click the Select button to see a list of all icons that the application has identified as available. Since the list contains a large number of icons, it is best to enter the name of the application directly into the input field next to “Icon:”

Spacefm graphic menu icon

In our case, before we even typed “Inkscape”, its icon was detected and displayed on the “Select” button. The button can also be used as a preview and any selected icon will be displayed on top of it as it will appear in the final button / menu.

Spacefm graphics menu more commands

Repeat the above steps to add more commands to the menu to make them match your favorite applications. Soon, you will get a menu similar to the one we saw in the picture, and with a single click, all selected files or folders in the selected application will immediately open.