How to open multiple files with SpaceFM in Linux

If you use a customizable file manager like SpaceFM, you can add a menu to the toolbar that allows you to quickly open multiple files with the application you want with just one click.

If you have to work with many types of graphic files every day, perhaps you also use different graphics applications to open and edit them. You may be wasting a lot of time without 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 option does not work at all times, because the application you want to use is not always displayed as the default program.

If you use a customizable file manager like SpaceFM, you can add a menu to the toolbar that allows you to quickly open multiple files with the application you want with just one click.

Although the article focuses on graphics, but that does not mean you are limited to this type of application. You can follow the steps below, but for example, replacing the graphics software with your favorite media player, creating a menu that allows you to open your favorite video files in a variety of ways.

Install SpaceFM

If not already available, find and install SpaceFM in your Linux distribution through the app store or software center. If you are using a Debian or Ubuntu-based distribution, you can install SpaceFM with the command:

 sudo apt-get install spacefm 

After installation, SpaceFM will be accessible from the main Application menu. Run this tool and resize the window to see the full contents of the main toolbar.

Picture 1 of How to open multiple files with SpaceFM in Linux

Add a new submenu

1. Right-click an empty position on the toolbar and select from the pop-up menu that appears under New> Submenu . This will allow adding a menu to the toolbar where you will group your main graphics applications.

Picture 2 of How to open multiple files with SpaceFM in Linux

2. Continue by naming the menu in the window that appears. The article is using 'Graphics' in this case.

Picture 3 of How to open multiple files with SpaceFM in Linux

3. SpaceFM does not like empty menus. So it placed a 'blank' command in the menu you just created. Select the command to display a window through which you will be able to modify it.

Picture 4 of How to open multiple files with SpaceFM in Linux

4. Enter a name for the command in the almost identical window that appears. Because the goal of the example is to easily open one or more graphics files with a selected application only once, each command will 'map' to an application. Probably best if you use the name of each application as the name of the button or command. For the first command, the article will name it 'Inkscape' .

Picture 5 of How to open multiple files with SpaceFM in Linux

5. The following window shows a similar editing space, where you can structure your commands but also have a handy code list. You can combine those codes in any regular BASH command (enter the editing space) to 'load' any selected file and folder.

Normally, when you want to be able to open files with applications that support doing that by command, all you need is the first 3 short codes. Most commands will contain the name of the application, followed by '% F', '% f' (note the lowercase f) or '% d' .

Picture 6 of How to open multiple files with SpaceFM in Linux

The first option, % F, works on all selected files (if the application supports batch loading). Use % f to perform action on a single file (works with most applications that support opening files). % d corresponds to the active directory (very rare but useful when, for example, batch conversion files between multiple formats).

Since the article wants to be able to open all the selected files in Inkscape for this first button, the command structure is as follows:

 inkscape %F 

This command is 'translated' as "Inkscape chose file 1, selected file 2, etc.". With this option, all 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 just add a button or submenu, you should have no problem recognizing it. In the case of more than one button, it is better to place different icons for each item, making them easy to identify at a glance.

To do this, go to the 'Menu Item' tab. You can click the Choose button to see a list of all icons that the app has identified as available. Because there are so many icons in the list, it is best to enter the name of the application directly into the input field next to 'Icon' :

Picture 7 of How to open multiple files with SpaceFM in Linux

In this case, before the completion of entering Inkscape, its icon was detected and displayed on the Choose button . This button also acts as a preview, with any of the icons selected above and it will be in the last button / menu.

Picture 8 of How to open multiple files with SpaceFM in Linux

Repeat the previous steps to add more commands to the menu, matching them to your favorite applications. You will soon have a menu similar to the one in the image, which allows you to instantly open any selected file (s) or folder in the application with one click.

Hope you are succesful.

Update 05 December 2019
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile