diff options
-rw-r--r-- | .makefile.kate-swp | bin | 0 -> 84 bytes | |||
-rw-r--r-- | makefile | 38 |
2 files changed, 18 insertions, 20 deletions
diff --git a/.makefile.kate-swp b/.makefile.kate-swp Binary files differnew file mode 100644 index 0000000..25821b5 --- /dev/null +++ b/.makefile.kate-swp @@ -2,7 +2,7 @@ # Variablen PROFILE_NAME="unifox" -PROFILE_DIR="$(HOME)/.mozilla/firefox" +PROFILE_DIR=$(HOME)/.mozilla/firefox # Ziel: alles all: setup @@ -10,45 +10,43 @@ all: setup # Ziel: setup setup: # Neues Profil erstellen - firefox -CreateProfile "$(PROFILE_NAME)" + firefox -CreateProfile $(PROFILE_NAME) # Pfad des neuen Profils ermitteln - NEW_PROFILE_PATH=$(shell grep -oP "(?<=^Path=).*$" "$(PROFILE_DIR)/profiles.ini" | grep "$(PROFILE_NAME)") + NEW_PROFILE_PATH=$(shell grep -oP "(?<=^Path=).*$" $(PROFILE_DIR)/profiles.ini | grep $(PROFILE_NAME)) # Notwendige Verzeichnisse erstellen - mkdir -p "$(PROFILE_DIR)/$(NEW_PROFILE_PATH)/chrome" - mkdir -p "$(PROFILE_DIR)/$(NEW_PROFILE_PATH)/chrome/img" + mkdir -p $(PROFILE_DIR)/$(NEW_PROFILE_PATH)/chrome + mkdir -p $(PROFILE_DIR)/$(NEW_PROFILE_PATH)/chrome/img # Konfigurationsdateien kopieren - cp -r chrome "$(PROFILE_DIR)/$(NEW_PROFILE_PATH)/" - cp prefs.js "$(PROFILE_DIR)/$(NEW_PROFILE_PATH)/" - cp addons.json "$(PROFILE_DIR)/$(NEW_PROFILE_PATH)/" + cp -r chrome $(PROFILE_DIR)/$(NEW_PROFILE_PATH)/ + cp prefs.js $(PROFILE_DIR)/$(NEW_PROFILE_PATH)/ + cp addons.json $(PROFILE_DIR)/$(NEW_PROFILE_PATH)/ # Add-ons installieren und konfigurieren - @$(MAKE) install_addons + $(MAKE) install_addons # Hintergrundbild kopieren - cp /path/to/custom/background.png "$(PROFILE_DIR)/$(NEW_PROFILE_PATH)/chrome/img/background.png" + cp /path/to/custom/background.png $(PROFILE_DIR)/$(NEW_PROFILE_PATH)/chrome/img/background.png # Finale Konfiguration - echo "user_pref('toolkit.legacyUserProfileCustomizations.stylesheets', true);" >> "$(PROFILE_DIR)/$(NEW_PROFILE_PATH)/prefs.js" + echo "user_pref('toolkit.legacyUserProfileCustomizations.stylesheets', true);" >> $(PROFILE_DIR)/$(NEW_PROFILE_PATH)/prefs.js @echo "Firefox setup for profile $(PROFILE_NAME) completed." # Ziel: Add-ons installieren install_addons: ADDON_LIST="ublock-origin decentraleyes istilldontcareaboutcookies vimimium-c" - ADDON_TMP="$(shell mktemp -d)" - trap "rm -fr $$ADDON_TMP" HUP INT QUIT TERM PWR EXIT - for ADDON in $$ADDON_LIST; do \ + ADDON_TMP=$(shell mktemp -d) + for ADDON in $(ADDON_LIST); do \ if [ "$$ADDON" = "ublock-origin" ]; then \ - ADDON_URL="$$($(shell curl -sL https://api.github.com/repos/gorhill/uBlock/releases/latest | grep -E 'browser_download_url.*\.firefox\.xpi' | cut -d '"' -f 4))"; \ + ADDON_URL=$$(curl -sL https://api.github.com/repos/gorhill/uBlock/releases/latest | grep -E 'browser_download_url.*\.firefox\.xpi' | cut -d '"' -f 4); \ else \ - ADDON_URL="$$($(shell curl --silent "https://addons.mozilla.org/en-US/firefox/addon/$$ADDON/" | grep -o 'https://addons.mozilla.org/firefox/downloads/file/[^"]*'))"; \ + ADDON_URL=$$(curl --silent "https://addons.mozilla.org/en-US/firefox/addon/$$ADDON/" | grep -o 'https://addons.mozilla.org/firefox/downloads/file/[^"]*'); \ fi \ - FILE="$$($(shell basename "$$ADDON_URL"))"; \ + FILE=$$(basename "$$ADDON_URL"); \ curl -LOs "$$ADDON_URL" -o "$$ADDON_TMP/$$FILE"; \ - ID="$$($(shell unzip -p "$$ADDON_TMP/$$FILE" manifest.json | grep "\"id\""))"; \ - ID="$$($(shell echo "$$ID" | sed 's/\"//g'))"; \ - mv "$$ADDON_TMP/$$FILE" "$(PROFILE_DIR)/$(NEW_PROFILE_PATH)/extensions/$$ID.xpi"; \ + ID=$$(unzip -p "$$ADDON_TMP/$$FILE" manifest.json | grep "\"id\"" | sed 's/\"//g'); \ + mv "$$ADDON_TMP/$$FILE" $(PROFILE_DIR)/$(NEW_PROFILE_PATH)/extensions/$$ID.xpi; \ done |