Add installation script proof of concept

This commit is contained in:
Rafael Mardojai CM 2019-07-11 11:58:40 -05:00
parent 16c2ffd213
commit 6aa38945d7
1 changed files with 37 additions and 0 deletions

37
scripts/install.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
FIREFOXFOLDER=~/.mozilla/firefox/
PROFILENAME=""
GNOMISHEXTRAS=false
while getopts 'f:p:g' flag; do
case "${flag}" in
f) FIREFOXFOLDER="${OPTARG}" ;;
p) PROFILENAME="${OPTARG}" ;;
g) GNOMISHEXTRAS=true ;;
esac
done
# Set and enter Firefox folder
cd $FIREFOXFOLDER
if test -z "$PROFILENAME"
then
if [[ $(grep '\[Profile[^0]\]' profiles.ini) ]]
then PROFPATH=$(grep -E '^\[Profile|^Path|^Default' profiles.ini | grep -1 '^Default=1' | grep '^Path' | cut -c6-)
else PROFPATH=$(grep 'Path=' profiles.ini | sed 's/^Path=//')
fi
else
PROFPATH=$PROFILENAME
fi
THEMEINSTALL="$FIREFOXFOLDER/$PROFPATH/chrome"
git clone https://github.com/rafaelmardojai/firefox-gnome-theme.git $THEMEINSTALL
if [ "$GNOMISHEXTRAS" = true ] ; then
cd $THEMEINSTALL
[[ -s customChrome.css ]] || echo >> customChrome.css
sed -i '1s/^/@import "theme\/hide-single-tab.css";\n/' customChrome.css
sed -i '2s/^/@import "theme\/matching-autocomplete-width.css";\n/' customChrome.css
fi