From 2271ca8ff2d28203637f5801da48ea7478f4b43f Mon Sep 17 00:00:00 2001 From: louie Date: Sun, 25 Jul 2021 19:40:59 -0700 Subject: Makefile can now install and uninstall linux desktop entry --- Makefile | 23 ++++++++++++++++++++++- icon/tml.desktop | 9 --------- 2 files changed, 22 insertions(+), 10 deletions(-) delete mode 100644 icon/tml.desktop diff --git a/Makefile b/Makefile index 7518cd4..823f8fc 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,23 @@ clean: ifneq ($(OS),Windows_NT) +.PHONY: desktop-entry +desktop-entry: + mkdir -p $(DESTDIR)$(PREFIX)/share/applications + echo "[Desktop Entry]" > $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + echo "Type=Application" >> $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + echo "Name=$(NAME)" >> $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + echo "Comment=Terminal Media Launcher" >> $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + echo "Path=$(DESTDIR)$(PREFIX)/bin" >> $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + echo "Exec=$(NAME)" >> $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + echo "Icon=$(NAME)" >> $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + echo "Terminal=true" >> $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + echo "Categories=Utility" >> $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps + cp -i icon/icon.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/tml.svg + desktop-file-install --dir=$(DESTDIR)$(PREFIX)/share/applications $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + update-desktop-database $(DESTDIR)$(PREFIX)/share/applications + .PHONY: install install: mkdir -p $(DESTDIR)$(PREFIX)/bin @@ -49,10 +66,14 @@ install: mkdir -p $(DESTDIR)$(PREFIX)/share/man/man5 cp -i docs/$(NAME)-config.5.gz $(DESTDIR)$(PREFIX)/share/man/man5/$(NAME)-config.5.gz -.PHONY: install +.PHONY: uninstall uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/$(NAME) rm -f $(DESTDIR)$(PREFIX)/share/man/man1/$(NAME).1.gz rm -f $(DESTDIR)$(PREFIX)/share/man/man5/$(NAME)-config.5.gz + rm -f $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + rm -f $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop + rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/$(NAME).svg + update-desktop-database $(DESTDIR)$(PREFIX)/share/applications endif diff --git a/icon/tml.desktop b/icon/tml.desktop deleted file mode 100644 index 0c3fb0c..0000000 --- a/icon/tml.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Type=Application -Name=tml -Comment=Terminal Media Launcher -Path=/usr/local/bin -Exec=tml -Icon=tml -Terminal=true -Categories=Utility -- cgit