diff --git a/Makefile b/Makefile index d8d2c33..5759793 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ build: ${GOCMD} build ${LDFLAGS} -o ${BINARY} .PHONY: install -install: install-bin install-man clean +install: install-bin install-man install-desktop clean .PHONY: install-man install-man: bombadillo.1 @@ -34,6 +34,20 @@ install-man: bombadillo.1 install -d ${DESTDIR}${MAN1DIR} install -m 0644 ./bombadillo.1.gz ${DESTDIR}${MAN1DIR} +.PHONY: install-desktop +install-desktop: +ifeq ($(shell uname), Linux) + # These steps will not work on Darwin, Plan9, or Windows + # They would likely work on BSD systems + install -d ${DESTDIR}${DATAROOTDIR}/applications + install -m 0644 ./bombadillo.desktop ${DESTDIR}${DATAROOTDIR}/applications + install -d ${DESTDIR}${DATAROOTDIR}/pixmaps + install -m 0644 ./bombadillo-icon.png ${DESTDIR}${DATAROOTDIR}/pixmaps + -update-desktop-database 2> /dev/null +else + @echo "* Skipping protocol handler associations and desktop file creation for non-linux system *" +endif + .PHONY: install-bin install-bin: build install -d ${DESTDIR}${BINDIR} @@ -48,6 +62,10 @@ clean: uninstall: clean rm -f ${DESTDIR}${MAN1DIR}/bombadillo.1.gz rm -f ${DESTDIR}${BINDIR}/${BINARY} + rm -f ${DESTDIR}${DATAROOTDIR}/applications/bombadillo.desktop + rm -f ${DESTDIR}${DATAROOTDIR}/pixmaps/bombadillo-icon.png + -update-desktop-database 2> /dev/null + .PHONY: test test: clean build diff --git a/bombadillo-icon.png b/bombadillo-icon.png new file mode 100644 index 0000000..6f10bd2 Binary files /dev/null and b/bombadillo-icon.png differ diff --git a/bombadillo.desktop b/bombadillo.desktop new file mode 100644 index 0000000..3ca2531 --- /dev/null +++ b/bombadillo.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=Bombadillo +GenericName=Non-Web Browser +Comment=View gopher, gemini, finger, telnet, http(s) sites over the internet +Terminal=true +Categories=Network;WebBrowser;ConsoleOnly; +Exec=bombadillo %U +Icon=bombadillo-icon +MimeType=x-scheme-handler/gopher;x-scheme-handler/gemini;x-scheme-handler/finger;