From 678aef7809e6f872dfab451b6e27ee83d5b661c2 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 30 Jun 2022 02:07:38 +0300 Subject: [PATCH] added basic .desktop support... Signed-off-by: Alex A. Naanou --- Viewer/Makefile | 23 +++++++++++++++++++++-- Viewer/templates/App.desktop | 9 +++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Viewer/templates/App.desktop diff --git a/Viewer/Makefile b/Viewer/Makefile index 67bb510a..3fc5f6fe 100644 --- a/Viewer/Makefile +++ b/Viewer/Makefile @@ -232,6 +232,9 @@ ELECTRON_DOWNOAD_URL ?= \ ELECTRON_DIST ?= electron-$(ELECTRON_VERSION)-$(TARGET_OS)-$(ARCH).zip +APP_DIR ?= $(HOME)/.local/share/applications/ + + BUILD_MODE ?= in-place @@ -645,6 +648,18 @@ electron-run: dev +##---------------------------------------------------- Open Desktop --- + +.PHONY: desktop +desktop: dev $(APP_NAME).desktop + desktop-file-install --dir="$(APP_DIR)" $(APP_NAME).desktop + +.PHONY: desktop-remove +desktop-remove: + rm -f $(APP_DIR)/$(APP_NAME).desktop + + + #********************************************************************** # helpers... @@ -699,8 +714,12 @@ $(BUILD_INFO): $(CSS_FILES) $(NODE_DIR) $(PROJECT_FILES) \ $(LESSC) $< > $@ -$(APP_NAME).desktop: App.desktop - mv $< $@ +# XXX get this from the install path... +$(APP_NAME).desktop: APP_LAUNCHER := $(shell pwd)/ig.js gui +$(APP_NAME).desktop: templates/App.desktop + cat $< \ + | sed 's#\$$LAUNCHER#$(APP_LAUNCHER)#' \ + > $@ # XXX might be a good idea to install directly to $(BUILD_DIR) so as not diff --git a/Viewer/templates/App.desktop b/Viewer/templates/App.desktop new file mode 100644 index 00000000..ac97cc90 --- /dev/null +++ b/Viewer/templates/App.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=ImageGrid.Viewer +Comment=Image sorting and editing application +Exec=$LAUNCHER +Icon= +Terminal=false +Type=Application +StartupNotify=true +Categories=