Gnome files Nautilus context menu “Open with” application list

六月ゝ 毕业季﹏ 提交于 2019-12-06 04:28:52

To install nautilus-action on Ubuntu, run simply this command via the Terminal:

sudo apt-get install nautilus-actions

(or equivalant packet manager as yum or pacman)

After the installation is complete, let's now see a quick example of how to add an extra action to the right-click menu with nautilus-actions.

The example consists of adding to the right-click menu the "Edit With Gimp" action to edit, for example, image files using The Gimp (Image Editor).

_Using the dash search "nautilus-actions" and click Nautilus-Actions Configuration.

_Under the Action tab, fill the following fields:

  • Context label: The text that will be displayed in the right-click menu, in our example, it's "Edit With Gimp"
  • Icon: This option allows to select an icon for your action (optional)

_Open now the Command tab and fill in the following fields:

  • Label: Enter any label of your choice for your action.
  • Path: Enter the path to the program you want to use using the Browse button. For our example, we will simply type "gimp".
  • Parameters: Click the Legend button to get suggested parameters. In our example, we will use the %f parameter to be able to edit image files with The Gimp.

_Log out the current session and log on again, or simply restart Nautilus with these commands from the Terminal:

nautilus -q
nautilus

Items in Nautilus's 'Open With Other Application' dialogue are added to to the 'recommended' list automatically after using it once (successfully).

Create a desktop-file in ~/.local/share/applications/ to add another item to the list of available applications.

Example entry to mount disk images (like LUKS container) writable (copied from /usr/share/applications/gnome-disk-image-mounter.desktop):

[Desktop Entry]
Name=Disk Image Mounter (rw)
Comment=Mount Disk Images writable
Exec=gnome-disk-image-mounter --writable %U
Icon=drive-removable-media
MimeType=application/x-cd-image;application/x-raw-disk-image;
Terminal=false
StartupNotify=false
Type=Application
NoDisplay=true

Refer to man update-desktop-database or man desktop-file-install for more information about desktop-files.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!