From: Michael Rasmussen Date: Sat, 26 Oct 2024 01:19:32 +0000 (+0200) Subject: Add desktop integration X-Git-Url: http://git.datanom.net/lensdb.git/commitdiff_plain/b62eba390a1432a62b6588ec1e2db20d931a5e40 Add desktop integration Signed-off-by: Michael Rasmussen --- diff --git a/Makefile.am b/Makefile.am index c8300b3..1509a0f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,5 +11,54 @@ EXTRA_DIST = \ ChangeLog \ NEWS \ README \ - autogen.sh + autogen.sh \ + lensdb.desktop \ + lensdb.png \ + lensdb-64x64.png \ + lensdb-128x128.png + +pixmapdir=$(datadir)/icons/hicolor/48x48/apps +pixmap_DATA=lensdb.png + +pixmap64dir=$(datadir)/icons/hicolor/64x64/apps +pixmap64_DATA=lensdb-64x64.png + +pixmap128dir=$(datadir)/icons/hicolor/128x128/apps +pixmap128_DATA=lensdb-128x128.png + +desktopdir = $(datadir)/applications +dist_desktop_DATA = lensdb.desktop + +rename-icons: + @cd $(DESTDIR)$(datadir)/icons/hicolor/64x64/apps && \ + mv lensdb-64x64.png lensdb.png + @cd $(DESTDIR)$(datadir)/icons/hicolor/128x128/apps && \ + mv lensdb-128x128.png lensdb.png + +remove-icons: + rm -f $(DESTDIR)$(datadir)/icons/hicolor/64x64/apps/lensdb.png + rm -f $(DESTDIR)$(datadir)/icons/hicolor/128x128/apps/lensdb.png + +if UPDATE_GTK_ICON_CACHE +gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor + +install-data-hook: rename-icons update-icon-cache +uninstall-hook: remove-icons update-icon-cache + +update-icon-cache: + @-if test -z "$(DESTDIR)"; then \ + echo "Updating Gtk icon cache."; \ + $(gtk_update_icon_cache); \ + else \ + echo "*** Icon cache not updated. Remember to run:"; \ + echo "***"; \ + echo "*** $(gtk_update_icon_cache)"; \ + echo "***"; \ + fi +else + +install-data-hook: rename-icons +uninstall-hook: remove-icons + +endif diff --git a/configure.ac b/configure.ac index 0ce4f80..0de5819 100644 --- a/configure.ac +++ b/configure.ac @@ -55,6 +55,9 @@ fi AC_SYS_LARGEFILE +AC_CHECK_PROG(HAVE_GTK_ICON_CACHE, gtk-update-icon-cache, yes, no) +AM_CONDITIONAL(UPDATE_GTK_ICON_CACHE, test x"$HAVE_GTK_ICON_CACHE" = xyes) + enable_exif_scanner=yes AC_MSG_CHECKING([whether to build EXIF scanner]) if test x"$HAVE_CXX" = xno; then diff --git a/lensdb-128x128.png b/lensdb-128x128.png new file mode 100644 index 0000000..ccb82d3 Binary files /dev/null and b/lensdb-128x128.png differ diff --git a/lensdb-64x64.png b/lensdb-64x64.png new file mode 100644 index 0000000..b8466ca Binary files /dev/null and b/lensdb-64x64.png differ diff --git a/lensdb.desktop b/lensdb.desktop new file mode 100644 index 0000000..1b83d23 --- /dev/null +++ b/lensdb.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Lens Database +Comment=Small application to catalog your camera lenses +Icon=lensdb +Exec=lensdb +Terminal=false +Categories=Graphics;Photography; +StartupNotify=true diff --git a/lensdb.png b/lensdb.png new file mode 100644 index 0000000..f18004e Binary files /dev/null and b/lensdb.png differ