r/kde•
mankofffoo

How to open multiple files in the same app

I have what I assume is a fairly common use-case that I can't get working on Kubuntu. I used to do this all the time on OS X, and can't figure out how to change my workflow, or get my oldworkflow to behave correctly on Kubuntu.

​

I'd like to open multiple files in one app. This could be several KML in Google Earth, or several GeoTIFFs in QGIS, etc.

​

In OS X, the "open" command can take multiple files and will open them all in one running instance of an application. "xdg-open" only takes 1 file as an argument.

​

My work-around is to try to use dolphin and the search feature which is "baloo", but as you may know baloo does not work well. If I create Folder1/file.tif and Folder2/file.tif I would like to run "xdg-open */file.tif" but cannot. If I search in dolphin, usually nothing is found because baloo doesn't update quickly enough. If I manually "balooctl index */*.tif" then I can find them in dolphin search, drag-and-drop, and everything "works". But it doesn't really work because I need to manually update balooctl.

​

Can anyone else suggest one of:

  1. An option for xdg-open that makes it use a running app? I can then script a wrapper that will take multiple arguments.

  2. A replacement for xdg-open that works better?

  3. A KDE-wide option to make (some) apps (sometimes) have a single instance, rather than opening multiple instances?

  4. An improvement to Dolphin and/or baloo so the GUI workflow is more efficient?

  5. Something else?

​

Thanks...

Posted Dec 10, 2018, 9:00 PM UTC

14
nicofeee:kde:•

I don't see what the problem is. I can select two files in dolphin, do a right click and open it.

If you want to do it from the cli you can write a small script that calls xdg-open for each argument

1
mankofffooOP•

Select 100 files in 100 folders is complicated. That is why my example had Folder/file.tif and Folder2/file.tif. I can't always control the folder/file names. I can create a script to make new folder and "ln -s" new filenames, then have them all in one folder and easily select-all, drag, and drop. That isn't as easy as just "xdg-open */file.tif", or a working baloo-search. Baloo in Dolphin hides the folders, making it easy (if baloo worked).

​

xdg-open launches a *new QGIS* for every file! That is the problem.

1
idontchooseanid:arch:•

xdg-open launches a *new QGIS* for every file! That is the problem.

So that's QGIS' problem to not provide a proper desktop file. Does it have a command line option to open a file in the existing session. You can create your own version of the desktop file and add the option there.

1
mankofffooOP•

Ah! Thanks for the hint. There is no CLI option, but now that I know this is a QGIS issue and not a KDE issue, I'll post a feature request to that project. I have run into this with several programs, and on OS X it was an OS-level functionality, so I thought that might be the case with Kubuntu too.

1