summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-15 02:34:28 +0200
committerwm4 <wm4@nowhere>2013-09-15 21:22:30 +0200
commitd6884defa7c6208848e694e482acd22c78e95ce9 (patch)
tree41863a93645ee51b81e7b8b9842730746b3e4cf1
parent132c7f1cf55482d8cf880f30c9b9d6ffc47a77b2 (diff)
downloadmpv-d6884defa7c6208848e694e482acd22c78e95ce9.tar.bz2
mpv-d6884defa7c6208848e694e482acd22c78e95ce9.tar.xz
Add mpv.desktop, let Makefile install the desktop file and the icons
The mpv.desktop file is taken from the Arch package [1]. It appears to be based on the mplayer2 git mplayer.desktop file (e.g. very similar MimeType field), with minor modifications applied by Arch package maintainers. Note that for now, this doesn't show a terminal (Terminal=false), which might not always be ideal. For example, if the file is audio only, or if VO initialization fails for some reason, mpv will run in the background and play audio without showing a window. But users prefer running it without terminal, and don't want to play audio files with it. Maybe a --force-window option will be added in the future, which would always create a VO window, and compensate for these issues. [1] https://aur.archlinux.org/packages/mpv-git/
-rw-r--r--Makefile28
-rw-r--r--etc/mpv.desktop21
2 files changed, 45 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index a689b3130c..676841ee72 100644
--- a/Makefile
+++ b/Makefile
@@ -427,10 +427,10 @@ DOCS/man/en/mpv.1 DOCS/man/en/mpv.pdf: DOCS/man/en/af.rst \
###### installation / clean / generic rules #######
-install: $(INSTALL_BIN) $(INSTALL_MAN) $(INSTALL_PDF)
-install-no-man: $(INSTALL_BIN)
-install-strip: $(INSTALL_BIN_STRIP) $(INSTALL_MAN) $(INSTALL_PDF)
-install-strip-no-man: $(INSTALL_BIN_STRIP)
+install: $(INSTALL_BIN) install-data $(INSTALL_MAN) $(INSTALL_PDF)
+install-no-man: $(INSTALL_BIN) install-data
+install-strip: $(INSTALL_BIN_STRIP) install-data $(INSTALL_MAN) $(INSTALL_PDF)
+install-strip-no-man: $(INSTALL_BIN_STRIP) install-data
install-dirs:
if test ! -d $(BINDIR) ; then $(INSTALL) -d $(BINDIR) ; fi
@@ -453,11 +453,31 @@ install-mpv-pdf-en: DOCS/man/en/mpv.pdf
if test ! -d $(DOCDIR)/mpv ; then $(INSTALL) -d $(DOCDIR)/mpv ; fi
$(INSTALL) -m 644 DOCS/man/en/mpv.pdf $(DOCDIR)/mpv/
+ICONSIZES = 16x16 32x32 64x64
+
+define ICON_INSTALL_RULE
+install-mpv-icon-$(size): etc/mpv-icon-8bit-$(size).png
+ $(INSTALL) -d $(prefix)/share/icons/hicolor/$(size)/apps
+ $(INSTALL) -m 644 etc/mpv-icon-8bit-$(size).png $(prefix)/share/icons/hicolor/$(size)/apps/mpv.png
+endef
+
+$(foreach size,$(ICONSIZES),$(eval $(ICON_INSTALL_RULE)))
+
+install-mpv-icons: $(foreach size,$(ICONSIZES),install-mpv-icon-$(size))
+
+install-mpv-desktop: etc/mpv.desktop
+ $(INSTALL) -d $(prefix)/share/applications
+ $(INSTALL) -m 644 etc/mpv.desktop $(prefix)/share/applications/
+
+install-data: install-mpv-icons install-mpv-desktop
+
uninstall:
$(RM) $(BINDIR)/mpv$(EXESUF)
$(RM) $(MANDIR)/man1/mpv.1
$(RM) $(MANDIR)/en/man1/mpv.1
$(RM) $(DOCDIR)/mpv/mpv.pdf
+ $(RM) $(prefix)/share/applications/mpv.desktop
+ $(RM) $(foreach size,$(ICONSIZES),$(prefix)/share/icons/hicolor/$(size)/apps/mpv.png)
clean:
-$(RM) $(call ADD_ALL_DIRS,/*.o /*.d /*.a /*.ho /*~)
diff --git a/etc/mpv.desktop b/etc/mpv.desktop
new file mode 100644
index 0000000000..afd30de5d7
--- /dev/null
+++ b/etc/mpv.desktop
@@ -0,0 +1,21 @@
+[Desktop Entry]
+Type=Application
+Name=mpv Media Player
+Name[ca]=Reproductor multimèdia mpv
+Name[pl]=mpv odtwarzacz multimedialny
+GenericName=Multimedia player
+Comment=Play movies and songs
+Comment[ca]=Reproduïu vídeos i cançons
+Comment[de]=Filme und Musik abspielen
+Comment[es]=Reproduzca vídeos y canciones
+Comment[fr]=Lecteur multimédia
+Comment[it]=Lettore multimediale
+Comment[zh]=多媒体播放器
+Comment[pl]=Odtwarzaj filmy i muzykę
+Icon=mpv
+TryExec=mpv
+Exec=mpv --really-quiet -- %F
+Terminal=false
+NoDisplay=true
+Categories=AudioVideo;Audio;Video;Player;TV;
+MimeType=application/ogg;application/x-ogg;application/sdp;application/smil;application/x-smil;application/streamingmedia;application/x-streamingmedia;application/vnd.rn-realmedia;application/vnd.rn-realmedia-vbr;audio/aac;audio/x-aac;audio/m4a;audio/x-m4a;audio/mp1;audio/x-mp1;audio/mp2;audio/x-mp2;audio/mp3;audio/x-mp3;audio/mpeg;audio/x-mpeg;audio/mpegurl;audio/x-mpegurl;audio/mpg;audio/x-mpg;audio/rn-mpeg;audio/scpls;audio/x-scpls;audio/vnd.rn-realaudio;audio/wav;audio/x-pn-windows-pcm;audio/x-realaudio;audio/x-pn-realaudio;audio/x-ms-wma;audio/x-pls;audio/x-wav;video/mpeg;video/x-mpeg;video/x-mpeg2;video/mp4;video/msvideo;video/x-msvideo;video/quicktime;video/vnd.rn-realvideo;video/x-ms-afs;video/x-ms-asf;video/x-ms-wmv;video/x-ms-wmx;video/x-ms-wvxvideo;video/x-avi;video/x-fli;video/x-flv;video/x-theora;video/x-matroska;video/webm;audio/x-flac;