Added theme options

Added:
	- Help flag, -h
	- Theme flag, -f
	- Updated readme file
This commit is contained in:
Reberti Carvalho Soares 2020-10-21 17:31:59 -03:00
parent e0a149b1cd
commit 4d41d1781f
No known key found for this signature in database
GPG Key ID: 8ACAD4697E4924A6
2 changed files with 26 additions and 2 deletions

View File

@ -45,6 +45,10 @@ This theme is supposed to work with current supported Firefox releases:
- `-p <profile_name>` *optional* - `-p <profile_name>` *optional*
- Set custom profile name, for example `e0j6yb0p.default-nightly` - Set custom profile name, for example `e0j6yb0p.default-nightly`
- Default: standard default profile - Default: standard default profile
- `-t <theme_name>` *optional*
- Set the colors used in the theme."
- Default: Adwaita.
- Options: `yaru`, `adwaita`.
### Manual installation ### Manual installation
1. Go to `about:support` in Firefox. 1. Go to `about:support` in Firefox.

View File

@ -3,6 +3,7 @@
THEMEDIRECTORY=$(cd `dirname $0` && cd .. && pwd) THEMEDIRECTORY=$(cd `dirname $0` && cd .. && pwd)
FIREFOXFOLDER=~/.mozilla/firefox FIREFOXFOLDER=~/.mozilla/firefox
PROFILENAME="" PROFILENAME=""
THEME=DEFAULT
# Determine firefox profile being currently used programatically # Determine firefox profile being currently used programatically
# credits: https://stackoverflow.com/questions/57526217/ # credits: https://stackoverflow.com/questions/57526217/
@ -13,10 +14,19 @@ function current_profile() {
# Get options. # Get options.
while getopts 'f:p:g' flag; do while getopts 'f:p:g:t:h' flag; do
case "${flag}" in case "${flag}" in
f) FIREFOXFOLDER="${OPTARG}" ;; f) FIREFOXFOLDER="${OPTARG}" ;;
p) PROFILENAME="${OPTARG}" ;; p) PROFILENAME="${OPTARG}" ;;
t) THEME="${OPTARG}" ;;
h)
echo "Gnome Theme Install Script:"
echo " -f <firefox_folder_path>. Set custom Firefox folder path."
echo " -p <profile_name>. Set custom profile name."
echo " -t <theme_name>. Set the colors used in the theme."
echo " -h to show this message."
exit 0
;;
esac esac
done done
@ -51,6 +61,16 @@ cp -R $THEMEDIRECTORY $PWD
# Import this theme at the beginning of the CSS files. # Import this theme at the beginning of the CSS files.
sed -i '1s/^/@import "firefox-gnome-theme\/userChrome.css";\n/' userChrome.css 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 .. cd ..
# Symlink user.js to firefox-gnome-theme one. # Symlink user.js to firefox-gnome-theme one.