From 3db31ccb7149b1d45317786df37e26d5232125dd Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 19 Jul 2024 10:31:23 -0300 Subject: Populate --- firefox-dev | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 firefox-dev (limited to 'firefox-dev') diff --git a/firefox-dev b/firefox-dev new file mode 100755 index 0000000..b04714c --- /dev/null +++ b/firefox-dev @@ -0,0 +1,54 @@ +#!/bin/bash +# +# Wrapper around firefox developer edition +# + +# Parameters +DIRNAME="`dirname $0`" + +if [ -e "$HOME/.local/bin/firefox-dev" ]; then + # Manually or hoarder installed + $HOME/.local/bin/firefox-dev +elif which hoarder &> /dev/null; then + hoarder install firefox-dev && $HOME/.local/bin/firefox-dev +elif which flatpak &> /dev/null; then + if ! flatpak list | grep -q ^org.mozilla.FirefoxDevEdition; then + # Install + sudo flatpak install -y --from https://firefox-flatpak.mojefedora.cz/org.mozilla.FirefoxDevEdition.flatpakref + + # Run this script again + $0 + else + # Check and set tridactyl + if [ -e "$DIRNAME/../tridactyl/native/tridactyl.json" ]; then + native="$HOME/.mozilla/native-messaging-hosts/" + + if [ ! -e "$native/tridactyl.json" ]; then + mkdir -p $native + + tridactyl="`cd $DIRNAME/../tridactyl/native/ &> /dev/null && pwd`" + cp $tridactyl/tridactyl.json $native + sed -i -e "s|REPLACE_ME_WITH_SED|$tridactyl/native_main.py|g" $native/tridactyl.json + fi + fi + + flatpak run org.mozilla.FirefoxDevEdition & + + # Woraround while we dont fix this issue + # https://elementaryos.stackexchange.com/questions/6796/why-does-firefox-keep-creating-a-desktop-folder + # https://superuser.com/questions/1266254/prevent-firefox-from-creating-desktop-folder + # http://docs.flatpak.org/en/latest/working-with-the-sandbox.html + # https://www.mankier.com/1/flatpak-override + while ! [ -d "$HOME/Desktop" ]; do + sleep 2 + done + + rmdir $HOME/Desktop $HOME/Downloads &> /dev/null + fi +else + # Install flatpak + sudo apt install flatpak -y + + # Run this script again + $0 +fi -- cgit v1.2.3