fenix-fox/fenix-fox.sh

63 lines
1.7 KiB
Bash
Executable file

#!/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
echo "dir chrome already there, take backup"
mv $installdir/chrome $installdir/chrome.original
fi
cp -r src/userChrome $installdir/chrome
ln -s $installdir/chrome/userChrome-fenix_fox.css $installdir/chrome/userChrome.css
}
# 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!"