#!/bin/sh # ## Variables # # firefox dirs firefox_root="$HOME/.mozilla/firefox" firefox_profiledir="*.default-release" installdir=`find $firefox_root -name $firefox_profiledir` # git repo fenix_fox="https://git.datenkastl.org/pmOS-tweaks/fenix-fox.git" clonedir="/tmp/fenix-fox" # ## Funktions # enable_profile_customizations() { echo "Enable *toolkit.legacyUserProfileCustomizations.stylesheets* with user.js" if [ ! -e "${installdir}/user.js" ]; then echo 'user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);' \ > $installdir/user.js elif grep -q toolkit.legacyUserProfileCustomizations.stylesheets $installdir/user.js then echo "user.js with *toolkit.legacyUserProfileCustomizations.stylesheets* already there" echo "Do nothing! Please enable manually if not enabled!" else echo "Enable *toolkit.legacyUserProfileCustomizations.stylesheets* with user.js" echo 'user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);' \ >> $installdir/user.js fi } deploy_fenix_fox() { echo "Copy files in place and enable fenix-fox" if [ -d "${installdir}/chrome" ]; then mv $installdir/chrome $installdir/chrome.original fi cp -r src/userChrome $installdir/chrome cp src/userChrome/userChrome-fenix_fox.css $installdir/chrome/ } # Clonerepo not in use clonerepo() { echo "clone fenix-fox to /tmp" mkdir -p $clonedir git clone $fenix_fox $clonedir } # ## Main # # Setup Profile Customizations in user.js enable_profile_customizations # Copy files to profile deploy_fenix_fox # finish echo "Finished! Restart firefox and enjoy your new design!"