As well as being a Panda I am also an artist, I make my artwork mostly in GIMP and save my pictures to a certain directory on my computer. However I have a slight inconvenience because I save my images in jpeg
format, however the default program to open jpeg
s is the Image Viewer
, and if I change it to GIMP
for convenience with my artwork, it means that all the other jpeg
s on my computer open in GIMP
, and I don't want them to so this is where the problem begins…
So I am wondering if there is any way to make it so that all jpeg
s opened in that certain directory on my computer open in GIMP
, but all other jpeg
s elsewhere open in the Image Viewer
?
Best Answer
You need a
desktop
file, and a wrapper script:The
desktop
fileCreate a desktop file
Add the configuration below (change the property for
Name
)Replace
user
inExec=/home/user/bin/jpeg-wrapper %f
with your username, the output ofReplace the icon name in
Icon=
with a name or path of your choiceUse
MimeType=image/jpeg
to specify the mime types of files for which the decision is to apply. Separate multiple mime types via;
Get the mime type via
e.g. for a text file
The wrapper script
Create a new script
Add the code below
Change
my_special_path
to your artwork folder. All subfolders are also considered.Change
open_with_special
to your special application (e.g.gimp
)Make your wrapper script executable
Restart Unity/GNOME Shell, for the GNOME Shell e.g. Alt-F2, type
r
and EnterAssociate one or more file types with the desktop file
Open your file manager and right click on a file for which the decision is to apply
Click Properties
Activate the tab Open With
Select the entry Special or Standard
Click Set as default
Enjoy ;)
Script checked here.