mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.5k stars 2.92k forks source link

Missing icon of desktop file #484

Closed simonbcn closed 10 years ago

simonbcn commented 10 years ago

Ubuntu 13.04 64 bits with Unity

~~The desktop file installed by mpv doesn't work. It doesn't appears in menus. Dash Unity shows this when I search mpv:~~ 20140116_01 14 13_01

I have reported this issue bad. The real problem is the icon associated to this desktop file. It's missing when I associate mpv to one video/audio file: 20140116_19 28 25_01

ghost commented 10 years ago

The mpv.desktop file has NoDisplay set to true:

NoDisplay means "this application exists, but don't display it in the menus". This can be useful to e.g. associate this 
application with MIME types, so that it gets launched from a file manager (or other apps), without having a menu entry 
for it (there are tons of good reasons for this, including e.g. the netscape -remote, or kfmclient openURL kind of stuff).

mpv is not a GUI program, so this wouldn't make much sense anyway.

simonbcn commented 10 years ago

I had deleted the NoDisplay clause and still it doesn't show it. Anyway, the real problem is the missing icon when I associate the program with a file: 20140116_19 28 25_01

ghost commented 10 years ago

We don't install the icon either. The icon the mpv window itself shows is baked into the binary and is set via X11.

qmega commented 10 years ago

Didn't that get changed recently? Here on Arch with a recent build from the AUR, I do get icons installed and working in context menus, etc.

This does appear to be here upstream, too: https://github.com/mpv-player/mpv/blob/26d6eb4a8ab4052d7f873ca0cc2c6b68f3d41a44/wscript_build.py#L476 https://github.com/mpv-player/mpv/blob/26d6eb4a8ab4052d7f873ca0cc2c6b68f3d41a44/etc/mpv.desktop#L20

Ubuntu probably just packages an old version.

ghost commented 10 years ago

Indeed we do, and always did, ever since we added the destkop file. Sorry for the wrong information.

mc4man commented 10 years ago

Generally this isn't a bug because what use would there be in opening mpv from the Dash? In any event some additional value can be gained by adding to the .desktop - audio/x-vorbis+ogg; video/x-ogm+ogg; This allows mpv to show in gnome-control-center > Details as a default choice for both audio & video though for Ubuntu one must have gnome-control-center >= 1:3.6.3-0ubuntu46 reference bug - https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/1251087 (your current .desktop is still lacking a bit in MimeTypes= though extending it may only be useful for the likes of DnD on unity launcher And %U is not an option, no need for --

ghost commented 10 years ago

your current .desktop is still lacking a bit in MimeTypes=

Just how many mime types need to be added? The list is already ridiculous long. Is there some match-all mime type for audio and video?

And %U is not an option, no need for --

The -- is followed by a space, and the standard unix command line convention to prevent arguments after it to be interpreted as option, such as filenames starting with --.

simonbcn commented 10 years ago

I have modified the desktop file:

[Desktop Entry]
Name=Reproductor multimédia mpv
GenericName=Multimedia player
Comment=Reproduzca vídeos y canciones
Keywords=Video;Movie;Film;Clip;Series;Player;DVD;
Exec=mpv %U
Icon=mpv
Terminal=false
NoDisplay=true
Type=Application
Categories=GTK;GNOME;AudioVideo;Player;Video;
MimeType=application/mxf;application/ogg;application/ram;application/sdp;application/smil;application/smil+xml;application/vnd.apple.mpegurl;application/vnd.ms-wpl;application/vnd.rn-realmedia;application/x-extension-m4a;application/x-extension-mp4;application/x-flac;application/x-flash-video;application/x-matroska;application/x-netshow-channel;application/x-ogg;application/x-quicktime-media-link;application/x-quicktimeplayer;application/x-shorten;application/x-smil;application/xspf+xml;audio/3gpp;audio/ac3;audio/AMR;audio/AMR-WB;audio/basic;audio/flac;audio/midi;audio/mp2;audio/mp4;audio/mpeg;audio/mpegurl;audio/ogg;audio/prs.sid;audio/vnd.rn-realaudio;audio/x-aiff;audio/x-ape;audio/x-flac;audio/x-gsm;audio/x-it;audio/x-m4a;audio/x-matroska;audio/x-mod;audio/x-mp3;audio/x-mpeg;audio/x-mpegurl;audio/x-ms-asf;audio/x-ms-asx;audio/x-ms-wax;audio/x-ms-wma;audio/x-musepack;audio/x-pn-aiff;audio/x-pn-au;audio/x-pn-realaudio;audio/x-pn-realaudio-plugin;audio/x-pn-wav;audio/x-pn-windows-acm;audio/x-realaudio;audio/x-real-audio;audio/x-s3m;audio/x-sbc;audio/x-scpls;audio/x-speex;audio/x-stm;audio/x-tta;audio/x-wav;audio/x-wavpack;audio/x-vorbis;audio/x-vorbis+ogg;audio/x-xm;image/vnd.rn-realpix;image/x-pict;misc/ultravox;text/google-video-pointer;text/x-google-video-pointer;video/3gp;video/3gpp;video/dv;video/divx;video/fli;video/flv;video/mp2t;video/mp4;video/mp4v-es;video/mpeg;video/msvideo;video/ogg;video/quicktime;video/vivo;video/vnd.divx;video/vnd.mpegurl;video/vnd.rn-realvideo;video/vnd.vivo;video/webm;video/x-anim;video/x-avi;video/x-flc;video/x-fli;video/x-flic;video/x-flv;video/x-m4v;video/x-matroska;video/x-mpeg;video/x-mpeg2;video/x-ms-asf;video/x-ms-asx;video/x-msvideo;video/x-ms-wm;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvx;video/x-nsv;video/x-ogm+ogg;video/x-theora+ogg;video/x-totem-stream;x-content/video-dvd;x-content/video-vcd;x-content/video-svcd;x-scheme-handler/pnm;x-scheme-handler/mms;x-scheme-handler/net;x-scheme-handler/rtp;x-scheme-handler/rtmp;x-scheme-handler/rtsp;x-scheme-handler/mmsh;x-scheme-handler/uvox;x-scheme-handler/icy;x-scheme-handler/icyx;

But after it's necessary update the desktop and icon database with:

sudo update-icon-caches /usr/share/icons/*
sudo update-desktop-database

Now the desktop file shows the icon associated.

ghost commented 10 years ago

Exec=mpv %U

Doesn't create a window for audio-only files, spams the .xsession-errors file with text, doesn't handle filenames starting with -.

simonbcn commented 10 years ago

I have modified to Exec=mpv --really-quiet --force-window %U and it works to me.

mc4man commented 10 years ago

the -- isn't important, doesn't do any of the noted issues here but will leave.. (& sorry, I forgot there was a space

As far as MimeTypes= line For context menu it's irrelevant, the %letter takes care of that. In terms of Ubuntu > unity launcher > DnD, the launcher icon is only active for listed mimetypes, so having a more complete list does matter. One could go nuts trying to account for all, over time I may try to create a more complete list and/or cull out unneeded. For audio though as per some user requests I've added a couple - x-shorten; audio/x-ape; audio/x-wavpack; audio/x-tta; audio/AMR; audio/ac3; application/octet-stream;

ghost commented 10 years ago

x-shorten;

I assume you meant audio/x-shorten, so I added that.

application/octet-stream;

Omitted this, it sounds like a bad idea.

ghost commented 10 years ago

PS: is there still any issue? I fail to understand the problem, apparently some weird interaction with gnome.

simonbcn commented 10 years ago

I have edit my first post. I have reported this bad. Sorry. The problem, IMHO, is in the install process. It should install the icons and then update the desktop and icon database with:

update-icon-caches /usr/share/icons/*
update-desktop-database
mc4man commented 10 years ago

simonbcn - you are building your own version? (Ubuntu only offers mpv in 14.04 dev & while I don't use it, I do install from time to time to bug check & it is fine as far as a context menu icon

simonbcn commented 10 years ago

Yes, the git version.

ghost commented 10 years ago

So is anyone of the opinion that calling update-icon-caches etc. on install is a must? Personally I'd like to avoid this. It'd be an annoyance if you don't have these tools installed, and it's not my fault that desktop environments need caches (which they can't even update automatically!) for their inefficient crap. But if it's somehow 100% standard everywhere, and just mpv is the odd one which fails out of the line, we can add it.

Nikoli commented 10 years ago

I think running update-icon-caches is task of package manager.

qmega commented 10 years ago

I think if that kind of thing is done at all, it should be done by the distro's package script. It's not mpv's job to handle that crap, and even if it tries, there will be issues not only with missing tools, but tools that have different names on different distros and such.

ghost commented 10 years ago

Thanks for the clarification. Then I see no further issues, and I'm closing it.