Added theme options
Added: - Help flag, -h - Theme flag, -f - Updated readme file
This commit is contained in:
parent
e0a149b1cd
commit
4d41d1781f
|
@ -45,6 +45,10 @@ This theme is supposed to work with current supported Firefox releases:
|
|||
- `-p <profile_name>` *optional*
|
||||
- Set custom profile name, for example `e0j6yb0p.default-nightly`
|
||||
- Default: standard default profile
|
||||
- `-t <theme_name>` *optional*
|
||||
- Set the colors used in the theme."
|
||||
- Default: Adwaita.
|
||||
- Options: `yaru`, `adwaita`.
|
||||
|
||||
### Manual installation
|
||||
1. Go to `about:support` in Firefox.
|
||||
|
|
|
@ -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 <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
|
||||
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."
|
Loading…
Reference in New Issue