Sunday, October 05, 2014

Create Ubuntu unity Launcher for the wine program irfanview


Irfanview was installed using the winetricks program, which requires to load an older version 4.33 found on oldapps.com
Then I created a launcher called  "irfanview.desktop" :
[Desktop Entry]
Type=Application
Name=Irfanview Program Loader
Exec=wine /home/paul/.local/share/wineprefixes/irfanview/drive_c/Program\ Files\ \(x86\)/IrfanView/i_view32.exe
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;
Icon=/home/paul/.local/share/applications/irfanview.png
NoDisplay=true
StartupNotify=true
This launcher is a .desktop file based on an askubuntu answer which starts by suggesting to copy an existing .desktop file from :
ls /usr/share/applications/*.desktop
I copied the wine launcher.
I changed the image based on this Ubuntu Handbook post.

Right click menu "open with"

It's also possible to edit context menus. I tried editing: "/home/paul/.local/share/applications/wine-extension-jpe.desktop"

I replaced the line starting with Exec by the following:

Exec=env WINEPREFIX="/home/paul/.local/share/wineprefixes/irfanview" wine start /ProgIDOpen IrfanView %f
I adapted the exec command from this message.
Now when I right click on a JPEG image, open with / Irfanview. Irfanview starts with the image open.

Associate as default application

May require to edit this file:
/usr/share/gnome/applications/defaults.list
 And this page recomments to add a mime type in the folder:
/usr/share/mimelnk/application/


No comments: