From 49698e65c550a864d8050cacd05e5e1ec9df9ff7 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 7 Aug 2020 23:10:52 +0200 Subject: [PATCH] src: wrap firefox binary, not .desktop entry Instead of trying to override the .desktop entry of Firefox by installing the custom one and adjusting XDG_DATA_DIRS, just wrap the firefox binary directly and adjust PATH. The former did not work with Phosh, and on second thought, wrapping the binary is what's really necessary. The launcher would have been just another useless layer. --- Makefile | 6 +++--- src/mobile-config-firefox.desktop | 11 ----------- src/mobile-config-firefox.sh | 4 ++-- src/mobile-config-path.sh | 3 +++ 4 files changed, 8 insertions(+), 16 deletions(-) delete mode 100644 src/mobile-config-firefox.desktop create mode 100644 src/mobile-config-path.sh diff --git a/Makefile b/Makefile index 441e101..2b2f61b 100644 --- a/Makefile +++ b/Makefile @@ -31,8 +31,8 @@ install: all install -Dm644 "out/userChrome.css" \ "$(DESTDIR)/etc/mobile-config-firefox/userChrome.css" install -Dm755 "src/mobile-config-firefox.sh" \ - "$(DESTDIR)/usr/bin/mobile-config-firefox" - install -Dm644 "src/mobile-config-firefox.desktop" \ - "$(DESTDIR)/usr/mobile-config/share/applications/org.mozilla.firefox.desktop" + "$(DESTDIR)/usr/mobile-config/bin/firefox" + install -Dm755 "src/mobile-config-path.sh" \ + "$(DESTDIR)/etc/profile.d/mobile-config-path.sh" .PHONY: all clean install diff --git a/src/mobile-config-firefox.desktop b/src/mobile-config-firefox.desktop deleted file mode 100644 index 0b5c542..0000000 --- a/src/mobile-config-firefox.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Exec=mobile-config-firefox %u -Icon=firefox -Type=Application -Terminal=false -Name=Firefox -GenericName=Web Browser -MimeType=text/html; -StartupNotify=true -Categories=Network;WebBrowser; -StartupWMClass=firefox diff --git a/src/mobile-config-firefox.sh b/src/mobile-config-firefox.sh index f5a21d5..57be005 100644 --- a/src/mobile-config-firefox.sh +++ b/src/mobile-config-firefox.sh @@ -23,9 +23,9 @@ for profiledir in ~/.mozilla/firefox/*/; do done if [ "$profile_found" = "true" ]; then - exec firefox "$@" + exec /usr/bin/firefox "$@" else profiledir=~/.mozilla/firefox/firefox.default prepare_profile "$profiledir" - exec firefox --profile "$profiledir" "$@" + exec /usr/bin/firefox --profile "$profiledir" "$@" fi diff --git a/src/mobile-config-path.sh b/src/mobile-config-path.sh new file mode 100644 index 0000000..d33dbb6 --- /dev/null +++ b/src/mobile-config-path.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +export PATH="/usr/local/bin:/usr/mobile-config/bin:$PATH"