11

I work with a lot of csv files and I open them with either gedit or libreoffice at different times. I would like to have them both in the context menu to save time.

In the past, there was this sub-menu where I could select open with and it lists other applications, without opening a second menu. This new behaviour wastes several useful seconds.

Is there an option to bring this context menu entry back? Or any hacks to get a similar behaviour?

2
  • 1
    It's just incredible how such a simple and obvious feature, readily available in other OS for years, is simply unavailable in Ubuntu.. – devoured elysium Aug 11 '19 at 23:41
  • How wonderful to have a progressive feature of the retrogradation. sudo apt install nemo I had to use Nemo for opening pictures, bring back ... bring back that Leroy Brown whoo whoo I want him back. – Sadaharu Wakisaka Jun 19 '20 at 0:43
8

I don't think you can bring the old behaviour back without adapting source code. However, clicking wise, the current behaviour is not that bad. As before, you need three clicks to launch a file/document with another application. The only difference is that the last step is a double-click rather than a single click. Yes, rather than clicking the application and then the "Select" button, you can double-click the application.

The first time, the "Recommended Applications" dialog will be empty. However, that list gets populated with the applications you designate. So in your case, "Text Editor" (gedit) and "Libreoffice Writer" will make it to that list. You select the program with a double click, whereas with the previous approach of the submenu, it would have been a single click.

Personally, I like the interface better, because the program icons are presented in a larger size and the dialog is not prone to closing when you hover the mouse a bit in the wrong direction.

Alternatively, you may workaround with nautilus script, but this is not sensitive to the file that you selected.

As a third option, you can configure fully context sensitive right-click menu items with the third party application nautilus-actions. Installation may nowadays be less straightforward, and if you get it working properly, you will face some learning curve. It is powerful but also a bit complex.

4

Instead of focusing trying to open multiple apps, let's have a single app that opens the file in multiple other apps. For that we can create a custom .desktop file in ./.local/share/applications/ and lets call it open_dual.desktop. Contents are as so ( Icon= is optional, so not included; also note I don't have libre office, so using wps in this example instead, but for you the command should be libreoffice --writer ):

[Desktop Entry]
Name=Dual Open
Exec=bash -c 'setsid gedit "$1" & setsid wps "$1" &' sh %F
Terminal=false
Type=Application
MimeType=text/plain;text/csv;

Once that is done you should be able to ad that to the "open with" menu.


Alternatively, as a Nautilus script. Save it in .local/share/nautilus/scripts/ and lets call it dual_open.sh

#!/usr/bin/env bash
setsid gedit "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" &
setsid libreoffice --writer "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" &

Make the script executable with chmod +x ~/.local/share/nautilus/scripts/dual_open.sh. Now you should have a menu "scripts" when you right click on the file and dual_open.sh should be available as an option.

1
  • Thank you. Most of the time, I need to see the data in a particular format at a time, e.g. plain text vs tabular format. So, I will have to open two apps and close one - not recommended if you are opening a 10000+ lines csv file! – tokyoCoder Sep 21 '18 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.