diff --git a/README.md b/README.md index 07ece7f..0d60dc7 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,10 @@ This theme is supposed to work with current supported Firefox releases: - `-p ` *optional* - Set custom profile name, for example `e0j6yb0p.default-nightly` - Default: standard default profile +- `-t ` *optional* + - Set the colors used in the theme." + - Default: Adwaita. + - Options: `yaru`, `adwaita`. ### Manual installation 1. Go to `about:support` in Firefox. diff --git a/scripts/install.sh b/scripts/install.sh index 8cc6614..532f739 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -3,6 +3,7 @@ THEMEDIRECTORY=$(cd `dirname $0` && cd .. && pwd) FIREFOXFOLDER=~/.mozilla/firefox PROFILENAME="" +THEME=DEFAULT # Determine firefox profile being currently used programatically # credits: https://stackoverflow.com/questions/57526217/ @@ -13,10 +14,19 @@ function current_profile() { # Get options. -while getopts 'f:p:g' flag; do +while getopts 'f:p:g:t:h' flag; do case "${flag}" in f) FIREFOXFOLDER="${OPTARG}" ;; p) PROFILENAME="${OPTARG}" ;; + t) THEME="${OPTARG}" ;; + h) + echo "Gnome Theme Install Script:" + echo " -f . Set custom Firefox folder path." + echo " -p . Set custom profile name." + echo " -t . Set the colors used in the theme." + echo " -h to show this message." + exit 0 + ;; esac done @@ -51,6 +61,16 @@ cp -R $THEMEDIRECTORY $PWD # Import this theme at the beginning of the CSS files. sed -i '1s/^/@import "firefox-gnome-theme\/userChrome.css";\n/' userChrome.css +if [ $THEME != "DEFAULT" ]; then + if [ $THEME = "yaru" ]; then + echo "Setting $THEME theme." + sed -i 's/#4a90d9/#864780/g' ./firefox-gnome-theme/theme/colors/light.css + sed -i 's/#15539e/#864780/g' ./firefox-gnome-theme/theme/colors/dark.css + fi +else + echo "No theme set, using default adwaite." +fi + cd .. # Symlink user.js to firefox-gnome-theme one. @@ -60,4 +80,4 @@ if ! ln -s chrome/firefox-gnome-theme/configuration/user.js user.js ; then echo "Please, manually copy theme's user.js contents to yours." fi -echo "Done." +echo "Done." \ No newline at end of file