Merge pull request #161 from KisuYami/master

Added theme options and help flag.
This commit is contained in:
Rafael Mardojai CM 2020-10-21 17:16:25 -05:00 committed by GitHub
commit fcf4c3de79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 327 additions and 1 deletions

View File

@ -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.

View File

@ -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."
echo '@import "firefox-gnome-theme\/theme/colors/dark-yaru.css";' >> userChrome.css
echo '@import "firefox-gnome-theme\/theme/colors/light-yaru.css";' >> userChrome.css
fi
else
echo "No theme set, using default adwaita."
fi
cd ..
# Symlink user.js to firefox-gnome-theme one.
@ -61,3 +81,4 @@ if ! ln -s chrome/firefox-gnome-theme/configuration/user.js user.js ; then
fi
echo "Done."

151
theme/colors/dark-yaru.css Normal file
View File

@ -0,0 +1,151 @@
@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* Variables that start with --gnome- are added by me and are assigned
* to elements somewhere in this code. The rest of the variables are
* built-in in Firefox, so you need to add an !important if you wanna
* override them. */
@media (prefers-color-scheme: dark) {
:root {
/* Browser area before a page starts loading */
--gnome-browser-before-load-background: #353535;
/* Toolbars */
--gnome-toolbar-background: #282828;
--gnome-toolbar-color: #ffffff;
--gnome-toolbar-border-color: #1b1b1b;
--gnome-toolbar-icon-fill: #eeeeec;
--gnome-inactive-toolbar-color: #919190;
--gnome-inactive-toolbar-background: #353535;
--gnome-inactive-toolbar-border-color: #202020;
--gnome-inactive-toolbar-icon-fill: #919190;
/* Sidebar */
--gnome-sidebar-background: #313131;
--gnome-inactive-sidebar-background: #323232;
/* Popups */
--gnome-menu-background: #2f2f2f;
--gnome-menu-border-color: #1b1b1b;
--gnome-popover-background: #353535;
--gnome-popover-border-color: #1b1b1b;
--gnome-popover-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
--gnome-popover-button-hover-background: #424242;
--gnome-popover-separator-color: rgba(0, 0, 0, 0.1);
/* Header bar */
--gnome-headerbar-background: linear-gradient(to top, #262626, #2b2b2b);
--gnome-headerbar-border-color: #070707;
--gnome-headerbar-box-shadow: inset 0 1px rgba(238, 238, 236, 0.07);
--gnome-inactive-headerbar-background: linear-gradient(#353535, #353535);
--gnome-inactive-headerbar-border-color: #202020;
--gnome-inactive-headerbar-box-shadow: inset 0 1px rgba(238, 238, 236, 0.07);
/* Buttons */
--gnome-button-background: linear-gradient(to top, #323232 2px, #353535);
--gnome-button-border-color: #1b1b1b;
--gnome-button-border-accent-color: #070707;
--gnome-button-box-shadow: inset 0 1px rgba(255, 255, 255, 0.02), 0 1px 2px rgba(0, 0, 0, 0.07);
--gnome-button-hover-background: linear-gradient(to top, #323232, #373737 1px);
--gnome-button-active-background: linear-gradient(#1e1e1e, #1e1e1e);
--gnome-button-active-border-color: #1b1b1b;
--gnome-button-active-border-accent-color: #000000;
--gnome-button-active-box-shadow: inset 0 1px rgba(255, 255, 255, 0);
--gnome-button-disabled-background: #323232;
--gnome-button-disabled-border-color: #202020;
--gnome-button-disabled-box-shadow: inset 0 1px rgba(255, 255, 255, 0);
--gnome-inactive-button-background: linear-gradient(#353535, #353535);
--gnome-inactive-button-border-color: #202020;
--gnome-inactive-button-box-shadow: inset 0 1px rgba(255, 255, 255, 0);
--gnome-button-suggested-action-background: linear-gradient(to top, #155099 2px, #864780);
--gnome-button-suggested-action-border-color: #0f3b71;
--gnome-button-suggested-action-border-accent-color: #092444;
--gnome-button-suggested-action-box-shadow: inset 0 1px rgba(255, 255, 255, 0.02), 0 1px 2px rgba(0, 0, 0, 0.07);
--gnome-button-suggested-action-hover-background: linear-gradient(to top, #155099, #1655a2 1px);
--gnome-button-suggested-action-active-background: #103e75;
--gnome-button-suggested-action-active-border-color: #0f3b71;
--gnome-button-suggested-action-active-box-shadow: inset 0 1px rgba(255, 255, 255, 0);
--gnome-button-destructive-action-background: linear-gradient(to top, #ae151c 2px, #b2161d);
--gnome-button-destructive-action-border-color: #851015;
--gnome-button-destructive-action-border-accent-color: #570b0e;
--gnome-button-destructive-action-box-shadow: inset 0 1px rgba(255, 255, 255, 0.02), 0 1px 2px rgba(0, 0, 0, 0.07);
--gnome-button-destructive-action-hover-background: linear-gradient(to top, #ae151c, #b7161d 1px);
--gnome-button-destructive-action-active-background: #8a1116;
--gnome-button-destructive-action-active-border-color: #851015;
--gnome-button-destructive-action-active-box-shadow: inset 0 1px rgba(255, 255, 255, 0);
/* Entries */
--gnome-entry-background: linear-gradient(#2d2d2d, #2d2d2d);
--gnome-entry-border-color: #1b1b1b;
--gnome-entry-box-shadow: inset 0 0 0 1px rgba(21, 83, 158, 0);
--gnome-entry-color: #ffffff;
--gnome-inactive-entry-background: linear-gradient(#303030, #303030);
--gnome-inactive-entry-border-color: #202020;
--gnome-inactive-entry-box-shadow: none;
--gnome-inactive-entry-color: #d6d6d6;
--gnome-focused-urlbar-border-color: #864780;
/* Switch */
--gnome-switch-background: #282828;
--gnome-switch-border-color: #1b1b1b;
--gnome-switch-slider-background: linear-gradient(to bottom, #3c3c3c 20%, #353535 90%);
--gnome-switch-slider-border-color: #111111;
--gnome-switch-slider-box-shadow: inset 0 1px rgba(255, 255, 255, 0.02), 0 1px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.07);
--gnome-switch-active-background: #864780;
--gnome-switch-active-border-color: #030c17;
--gnome-switch-active-slider-border-color: #030c17;
/* Tabs */
--gnome-tabbar-tab-color: rgb(141, 144, 145);
--gnome-tabbar-tab-background: #282828;
--gnome-tabbar-tab-border-color: #242424;
--gnome-tabbar-tab-hover-background: #2b2b2b;
--gnome-tabbar-tab-hover-border-bottom-color: #1b1b1b;
--gnome-tabbar-tab-hover-color: rgb(200, 200, 200);
--gnome-tabbar-tab-active-background: #2e2e2e;
--gnome-tabbar-tab-active-background-contrast: #4c4c4c;
--gnome-tabbar-tab-active-border-bottom-color: #864780;
--gnome-tabbar-tab-active-border-bottom-color-contrast: #448de5;
--gnome-tabbar-tab-active-color: #ffffff;
--gnome-tabbar-tab-active-hover-background: #313131;
--gnome-inactive-tabbar-tab-color: rgb(141, 144, 145);
--gnome-inactive-tabbar-tab-background: #2e2e2e;
--gnome-inactive-tabbar-tab-active-background: #353535;
--gnome-inactive-tabbar-tab-active-border-bottom-color: #864780;
--gnome-inactive-tabbar-tab-active-color: rgb(141, 144, 145);
}
/* Private window colors */
:root {
/* Header bar */
--gnome-private-headerbar-background: linear-gradient(to top, rgb(81, 44, 109), rgb(86, 47, 116));
--gnome-private-headerbar-border-color: rgb(49, 27, 66);
--gnome-private-headerbar-box-shadow: 0 1px rgba(255, 255, 255, .07) inset;
--gnome-private-inactive-headerbar-background: #613583;
--gnome-private-inactive-headerbar-border-color: rgb(77, 41, 102);
--gnome-private-inactive-headerbar-box-shadow: var(--gnome-private-headerbar-box-shadow);
/* Buttons */
--gnome-private-button-background: linear-gradient(to top, rgb(94, 52, 127) 2px, rgb(97, 53, 131));
--gnome-private-button-border-color: rgb(70, 38, 95);
--gnome-private-button-border-accent-color: rgb(49, 27, 66);
--gnome-private-button-box-shadow: 0 1px rgba(255, 255, 255, .02) inset, 0 1px 2px rgba(0, 0, 0, .07);
--gnome-private-button-hover-background: linear-gradient(to top, rgb(94, 52, 127), rgb(100, 54, 135) 1px);
--gnome-private-button-active-background: rgb(73, 40, 98);
--gnome-private-button-active-border-color: rgb(62, 34, 84);
--gnome-private-button-active-border-accent-color: rgb(49, 27, 66);
--gnome-private-button-active-box-shadow: 0 1px rgba(255, 255, 255, 0) inset;
--gnome-private-button-disabled-background: #613583;
--gnome-private-button-disabled-border-color: rgb(74, 41, 102);
--gnome-private-button-disabled-box-shadow: 0 1px rgba(255, 255, 255, 0) inset;
--gnome-private-inactive-button-background: #613583;
--gnome-private-inactive-button-border-color: rgb(74, 41, 102);
--gnome-private-inactive-button-box-shadow: 0 1px rgba(255, 255, 255, 0) inset;
/* Entries */
--gnome-private-entry-border-color: #202020;
--gnome-private-focused-urlbar-border-color: rgb(158, 70, 224);
/* Tabs */
--gnome-private-tabbar-tab-active-border-bottom-color: rgb(158, 70, 224);
}
}

150
theme/colors/light-yaru.css Normal file
View File

@ -0,0 +1,150 @@
@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* Variables that start with --gnome- are added by me and are assigned
* to elements somewhere in this code. The rest of the variables are
* built-in in Firefox, so you need to add an !important if you wanna
* override them. */
:root {
/* Browser area before a page starts loading */
--gnome-browser-before-load-background: #d6d6d6;
/* Toolbars */
--gnome-toolbar-background: #e0ddda;
--gnome-toolbar-color: rgb(46, 52, 54);
--gnome-toolbar-border-color: #b6b6b3;
--gnome-toolbar-icon-fill: #2e3436;
--gnome-inactive-toolbar-background: #f6f5f4;
--gnome-inactive-toolbar-color: #d5d0cc;
--gnome-inactive-toolbar-border-color: #d5d0cc;
--gnome-inactive-toolbar-icon-fill: #929595;
/* Sidebar */
--gnome-sidebar-background: #fbfafa;
--gnome-inactive-sidebar-background: #f9f9f8;
/* Popups */
--gnome-menu-background: #ffffff;
--gnome-menu-border-color: #cdc7c2;
--gnome-popover-background: #f6f5f4;
--gnome-popover-border-color: #cdc7c2;
--gnome-popover-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
--gnome-popover-button-hover-background: #ffffff;
--gnome-popover-separator-color: rgba(0, 0, 0, 0.1);
/* Header bar */
--gnome-headerbar-background: linear-gradient(to top, /*#dad6d2,*/ #cdc9c3, #ddd9d5 2px, #e0ddda);
--gnome-headerbar-border-color: #bdb7b0;
--gnome-headerbar-box-shadow: 0 -1px rgb(217, 217, 217) inset, 0 1px #fff inset;
--gnome-inactive-headerbar-background: linear-gradient(#f6f5f4, #f6f5f4);
--gnome-inactive-headerbar-border-color: #d5d0cc;
--gnome-inactive-headerbar-box-shadow: 0 1px #fff inset;
/* Buttons */
--gnome-button-background: linear-gradient(to top, #edebe9 2px, #f6f5f4);
--gnome-button-border-color: #cdc7c2;
--gnome-button-border-accent-color: #bfb8b1;
--gnome-button-box-shadow: inset 0 1px white, 0 1px 2px rgba(0, 0, 0, 0.07);
--gnome-button-hover-background: linear-gradient(to top, #f6f5f4, #f8f8f7 1px);
--gnome-button-active-background: linear-gradient(#cfcac4, #cfcac4);
--gnome-button-active-border-color: #c6bfb9;
--gnome-button-active-border-accent-color: #bab3ab;
--gnome-button-active-box-shadow: 0 1px rgba(255, 255, 255, 0) inset;
--gnome-button-disabled-background: #faf9f8;
--gnome-button-disabled-border-color: #cdc7c2;
--gnome-button-disabled-box-shadow: inset 0 1px rgba(255, 255, 255, 0);
--gnome-inactive-button-background: linear-gradient(#f6f5f4, #f6f5f4);
--gnome-inactive-button-border-color: #d5d0cc;
--gnome-inactive-button-box-shadow: 0 1px rgba(255, 255, 255, 0) inset, 0 1px rgba(255, 255, 255, 0);
--gnome-button-suggested-action-background: linear-gradient(to top, #2379e2 2px, #3584e4);
--gnome-button-suggested-action-border-color: #1b6acb;
--gnome-button-suggested-action-border-accent-color: #15539e;
--gnome-button-suggested-action-box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.07);
--gnome-button-suggested-action-hover-background: linear-gradient(to top, #3584e4, #3987e5 1px);
--gnome-button-suggested-action-active-background: #1961b9;
--gnome-button-suggested-action-active-border-color: #1b6acb;
--gnome-button-suggested-action-active-box-shadow: inset 0 1px rgba(255, 255, 255, 0);
--gnome-button-destructive-action-background: linear-gradient(to top, #ce1921 2px, #e01b24);
--gnome-button-destructive-action-border-color: #b2161d;
--gnome-button-destructive-action-border-accent-color: #851015;
--gnome-button-destructive-action-box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.07);
--gnome-button-destructive-action-hover-background: linear-gradient(to top, #e01b24, #e41c26 1px);
--gnome-button-destructive-action-active-background: #a0131a;
--gnome-button-destructive-action-active-border-color: #b2161d;
--gnome-button-destructive-action-active-box-shadow: inset 0 1px rgba(255, 255, 255, 0);
/* Entries */
--gnome-entry-background: linear-gradient(#fff, #fff);
--gnome-entry-border-color: #b6b6b3;
--gnome-entry-box-shadow: none;
--gnome-entry-color: #020202;
--gnome-inactive-entry-background: linear-gradient(#fcfcfc, #fcfcfc);
--gnome-inactive-entry-border-color: #d5d0cc;
--gnome-inactive-entry-box-shadow: none;
--gnome-inactive-entry-color: #323232;
--gnome-focused-urlbar-border-color: #864780;
/* Switch */
--gnome-switch-background: #e1dedb;
--gnome-switch-border-color: #cdc7c2;
--gnome-switch-slider-background: linear-gradient(to bottom, white 10%, white 90%);
--gnome-switch-slider-border-color: #bfb8b1;
--gnome-switch-slider-box-shadow: inset 0 1px white, 0 1px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.07);
--gnome-switch-active-background: #3584e4;
--gnome-switch-active-border-color: #185fb4;
--gnome-switch-active-slider-border-color: #185fb4;
/* Tabs */
--gnome-tabbar-tab-color: #2e3436;
--gnome-tabbar-tab-background: #e1dedb;
--gnome-tabbar-tab-border-color: #dbd7d4;
--gnome-tabbar-tab-hover-background: #e4e2de;
--gnome-tabbar-tab-hover-border-bottom-color: #b6b6b3;
--gnome-tabbar-tab-hover-color: #2e3436;
--gnome-tabbar-tab-active-background: #ebe9e7;
--gnome-tabbar-tab-active-background-contrast: #F7F5F3;
--gnome-tabbar-tab-active-border-bottom-color: #864780;
--gnome-tabbar-tab-active-border-bottom-color-contrast: #864780;
--gnome-tabbar-tab-active-color: #2e3436;
--gnome-tabbar-tab-active-hover-background: #e6e6e6;
--gnome-inactive-tabbar-tab-color: #929595;
--gnome-inactive-tabbar-tab-background: #eae8e6;
--gnome-inactive-tabbar-tab-active-background: #f6f5f4;
--gnome-inactive-tabbar-tab-active-border-bottom-color: var(--gnome-tabbar-tab-active-border-bottom-color);
--gnome-inactive-tabbar-tab-active-color: var(--gnome-inactive-tabbar-tab-color);
}
/* Private window colors */
:root {
/* Header bar */
--gnome-private-headerbar-background: linear-gradient(to top, rgb(206, 191, 219), rgb(214, 201, 255));
--gnome-private-headerbar-border-color: rgb(176, 152, 197);
--gnome-private-headerbar-box-shadow: 0 1px rgba(255, 255, 255, .8) inset;
--gnome-private-inactive-headerbar-background: #ECE6F1;
--gnome-private-inactive-headerbar-border-color: rgb(200, 183, 215);
--gnome-private-inactive-headerbar-box-shadow: var(--gnome-private-headerbar-box-shadow);
/* Buttons */
--gnome-private-button-background: linear-gradient(to top, rgb(226, 217, 234) 2px, rgb(236, 230, 241));
--gnome-private-button-border-color: rgb(191, 171, 208);
--gnome-private-button-border-accent-color: rgb(179, 152, 197);
--gnome-private-button-box-shadow: 0 1px rgba(255, 255, 255, .8) inset, 0 1px 2px rgba(0, 0, 0, .07);
--gnome-private-button-hover-background: linear-gradient(to top, rgb(236, 230, 241), rgb(238, 233, 243) 1px);
--gnome-private-button-active-background: rgb(194, 174, 210);
--gnome-private-button-active-border-color: rgb(184, 161, 203);
--gnome-private-button-active-border-accent-color: rgb(171, 145, 194);
--gnome-private-button-active-box-shadow: 0 1px rgba(255, 255, 255, 0) inset;
--gnome-private-button-disabled-background: #ECE6F1;
--gnome-private-button-disabled-border-color: rgb(200, 183, 215);
--gnome-private-button-disabled-box-shadow: 0 1px rgba(255, 255, 255, 0) inset;
--gnome-private-inactive-button-background: #ECE6F1;
--gnome-private-inactive-button-border-color: rgb(200, 183, 215);
--gnome-private-inactive-button-box-shadow: 0 1px rgba(255, 255, 255, 0) inset;
/* Entries */
--gnome-private-entry-border-color: rgb(191, 171, 208);
--gnome-private-focused-urlbar-border-color: rgb(132, 77, 179);
/* Tabs */
--gnome-private-tabbar-tab-active-border-bottom-color: rgb(132, 77, 179);
}