It is possible to set a portable application as default, but if you have a special filetype (e.g. .skp for SketchUp under Wine), you need to create a mimetype, and then add the 'MimeType' to the launcher file (I found this out by looking at wine deals with stuff by placing launchers in ~/.local/share/applications
and stuff in ~/.local/share/mime
). You can check if it has a mimetype by looking at the File's properties in Nautilus (may work with other file managers):
If the mimetype already exists (e.g. text/plain
), it is quite easy to make a launcher for it. As an example, you can create a launcher like this:
[Desktop Entry]
Type=Application
Name=Custom Program
Icon=firefox
MimeType=text/plain;
Exec=gnome-terminal -e "nano %f "
NoDisplay=true
StartupNotify=true
save it to ~/.local/share/applications/Custom Program.desktop
, and you should get (perhaps after logout/login, restarting the file manager, running update-desktop-database ~/.local/share/applications/
or something):
Which should be able to open txt files in nano
in gnome terminal. You should also be able to make this program default in the File manager;s properties.
If you are using a custom version of a existing system installed version of a program such as VLC, you can make/edit a launcher based on the existing one in /usr/share/applications
:
[Desktop Entry]
Version=1.0
Name=VLC media player
GenericName=Media player
Comment=Read, capture, broadcast your multimedia streams
Exec=/usr/bin/vlc --started-from-file %U
TryExec=/usr/bin/vlc
Icon=vlc
Terminal=false
Type=Application
Categories=AudioVideo;Player;Recorder;
MimeType=video/dv;video/mpeg;video/x-mpeg;video/msvideo;video/quicktime;video/x-anim;video/x-avi;video/x-ms-asf;video/x-ms-wmv;video/x-msvideo;video/x-nsv;video/x-flc;video/x-fli;video/x-flv;video/vnd.rn-realvideo;video/mp4;video/mp4v-es;video/mp2t;application/ogg;application/x-ogg;video/x-ogm+ogg;audio/x-vorbis+ogg;audio/ogg;video/ogg;application/x-matroska;audio/x-matroska;video/x-matroska;video/webm;audio/webm;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-wav;audio/x-mpegurl;audio/x-scpls;audio/x-m4a;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;application/vnd.rn-realmedia;audio/x-real-audio;audio/x-pn-realaudio;application/x-flac;audio/x-flac;application/x-shockwave-flash;misc/ultravox;audio/vnd.rn-realaudio;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-wav;audio/x-pn-windows-acm;image/vnd.rn-realpix;audio/x-pn-realaudio-plugin;application/x-extension-mp4;audio/mp4;audio/amr;audio/amr-wb;x-content/video-vcd;x-content/video-svcd;x-content/video-dvd;x-content/audio-cdda;x-content/audio-player;application/xspf+xml;x-scheme-handler/mms;x-scheme-handler/rtmp;x-scheme-handler/rtsp;
X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb
Keywords=Player;Capture;DVD;Audio;Video;Server;Broadcast;
X-Desktop-File-Install-Version=0.22
You could use this, modify the Exec and Name path (you can remove the TryExec), add it to one of the application launcher directories, and have your own custom VLC launcher :)
See also:
For an example on how to set as default portable applications downloaded from portablelinuxapps.org or others made portable with the utilities that can be also downloaded from there, take a look at this answer about VLC.