You are not logged in.
Hello,
How can I add CLI programs such as sxiv Image Viewer to the Open With context menu entry in Nautilus?
In particular I want to open images with sxiv by default when clicking on the image in Nautilus.
Thanks
Last edited by orschiro (2013-08-09 20:21:56)
Offline
What I have done (I use rox but that shouldn't make a difference) is to create a script and put that in /usr/bin.
In the script I start a new terminal (in my case guake) and run the program in that terminal:
gnome-terminal -e "sxiv '$1'"Make sure you make the script executable. By putting it in /usr/bin it will be reachable system-wide and also tab-autocomplete
Offline
I think the list of "Open With" applications is created by reading the ".desktop" files that are on your computer. You can read about them here. The sysem files are in "/usr/share/applications" and your personal ones are in "~/.local/share/applications". Just create a .desktop file for sxiv that uses a command similar to the one cellisten posted.
GNOME probably also has a way to create .desktop files with a GUI (I think it used to be called "alacarte").
What I have done is to create a script and put that in /usr/bin.
Did you copy your OWN file into a directory that's controlled by pacman?
![]()
Offline
As drcouzelis pointed out, I would rather put my .desktop in ~ instead of /usr/bin. The following one works out brilliantly:
[orschiro@thinkpad ~]$ cat .local/share/applications/sxiv.desktop
[Desktop Entry]
Name=sxiv
Comment=A Simple X Image Viewer
Exec=sxiv %f
Terminal=false
Type=Application
Icon=sxiv
Categories=GTK;Graphics;2DGraphics;Viewer;
MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-pcx;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-sun-raster;image/x-tga;image/x-xbitmap;image/x-xpixmap;image/svg+xml;Offline
You are both completely right, I managed to find the correct place where rox stores the commands to edit them manually.
Offline