Skip to contentSkip to conversation

gitk: Add desktop file

PATCH New Jonas Ådahl 1 participant 1 message May 23, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gitk: Add desktop file

This makes it properly integrate with desktop environments, by e.g. grouping different gitk windows, getting an app icon, ability to add keywords for searching.

It's marked as 'NoDisplay' meaning it will not show up as a launchable application, as that makes no sense for gitk.

---
 gitk-git/Makefile        |   8 +++++++-
 gitk-git/gitk.desktop.in |  12 ++++++++++++
 gitk-git/gitk.png        | Bin 0 -> 4257 bytes
 3 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 gitk-git/gitk.desktop.in
 create mode 100644 gitk-git/gitk.png
gitk-git/Makefile +7 -1
index e1f0aff4a1..e738176fd6 100644
@@ -15,6 +15,7 @@ RM ?= rm -f
 
 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 bindir_SQ = $(subst ','\'',$(bindir))
+sharedir_SQ = $(subst ','\'',$(sharedir))
 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
 
 ### Detect Tck/Tk interpreter path changes
@@ -47,12 +48,14 @@ ifndef V
 	QUIET_GEN      = $(QUIET)echo '   ' GEN $@ &&
 endif
 
-all:: gitk-wish $(ALL_MSGFILES)
+all:: gitk-wish $(ALL_MSGFILES) gitk.desktop
 
 install:: all
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
 	$(INSTALL) -m 755 gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(msgsdir_SQ)'
+	$(INSTALL) gitk.desktop '$(DESTDIR_SQ)$(sharedir_SQ)'/applications/gitk.desktop
+	$(INSTALL) gitk.png '$(DESTDIR_SQ)$(sharedir_SQ)'/gitk/
 	$(foreach p,$(ALL_MSGFILES), $(INSTALL) -m 644 $p '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
 
 uninstall::
@@ -76,5 +79,8 @@ $(ALL_MSGFILES): %.msg : %.po
 	@echo Generating catalog $@
 	$(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
 
+gitk.desktop: gitk.desktop.in
+	sed -e "s,@iconpath@,$(DESTDIR_SQ)$(sharedir_SQ)/gitk/gitk.png," $< > $@
+
 .PHONY: all install uninstall clean update-po
 .PHONY: FORCE
gitk-git/gitk.desktop.in new file +12 -0
new file mode 100644
index 0000000000..b18a50fe2f
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Name=Gitk
+GenericName=Gitk
+Comment=The Git repository browser
+Exec=gitk
+Icon=@iconpath@
+Terminal=false
+Type=Application
+Categories=Development;
+X-Desktop-File-Install-Version=0.26
+NoDisplay=true
+Keywords=git;repository
gitk-git/gitk.png new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..21f21b39ec44b14bb44161305b26ab4f0fc64ead
GIT binary patch
Signature · 1 line
2.44.0