diff --git a/README.md b/README.md index c24fe38f..229043f5 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,10 @@ Run the following commands in the terminal: -s, --size VARIANT... Specify size variant [standard|compact] (Default: standard variant) -l, --libadwaita Install specify gtk-4.0 theme into config folder (~/.config/gtk-4.0) for all gtk4 apps use this theme - (Default ColorSchemes themes will follow the system style, [nord|dracula|gruvbox|everforest|black] not support this) - --r, --remove, --u, --uninstall Uninstall/Remove installed themes or links + Default ColorSchemes theme will follow the system style (light/dark mode switch), nord|dracula|gruvbox|everforest|black ColorSchemes not support this + Options for default ColorSchemes: + 1. system Default option (using system colors for light/dark mode switching) + 2. fixed Using fixed theme colors (that will break light/dark mode switch) --tweaks Specify versions for tweaks 1. [nord|dracula|gruvbox|all] (Nord/Dracula/gruvbox/all) ColorSchemes version @@ -53,6 +53,9 @@ Run the following commands in the terminal: 4. normal Normal windows button style like gnome default theme (titlebuttons: max/min/close) 5. float Floating gnome-shell panel style +-r, --remove, +-u, --uninstall Uninstall/Remove installed themes or links + -h, --help Show help ``` diff --git a/install.sh b/install.sh index dfc5da49..88c066cd 100755 --- a/install.sh +++ b/install.sh @@ -30,7 +30,7 @@ COLOR_VARIANTS=('' '-Light' '-Dark') SIZE_VARIANTS=('' '-Compact') if [[ "$(command -v gnome-shell)" ]]; then - gnome-shell --version + echo && gnome-shell --version SHELL_VERSION="$(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f -1)" if [[ "${SHELL_VERSION:-}" -ge "46" ]]; then GS_VERSION="46-0" @@ -63,11 +63,11 @@ OPTIONS: -s, --size VARIANT Specify size variant [standard|compact] (Default: standard variant) - -l, --libadwaita Install specify gtk-4.0 theme into config folder (~/.config/gtk-4.0) for all gtk4 apps use this theme - (Default ColorSchemes theme will follow the system style, nord|dracula|gruvbox|everforest|black not support this) - - -r, --remove, - -u, --uninstall Uninstall/Remove installed themes or links + -l, --libadwaita Install specify gtk-4.0 theme into config folder ($HOME/.config/gtk-4.0) for all gtk4 apps use this theme + Default ColorSchemes theme will follow the system style (light/dark mode switch), nord|dracula|gruvbox|everforest|black ColorSchemes not support this + Options for default ColorSchemes: + 1. system Default option (using system colors for light/dark mode switching) + 2. fixed Using fixed theme colors (that will break light/dark mode switch) --tweaks Specify versions for tweaks 1. [nord|dracula|gruvbox|everforest|all] Nord|Dracula|gruvbox|everforet|all ColorSchemes version @@ -76,6 +76,9 @@ OPTIONS: 4. normal Normal windows button style like gnome default theme (titlebuttons: max/min/close) 5. float Floating gnome-shell panel style + -r, --remove, + -u, --uninstall Uninstall/Remove installed themes or links + -h, --help Show help EOF } @@ -166,7 +169,7 @@ while [[ $# -gt 0 ]]; do -d|--dest) dest="${2}" if [[ ! -d "${dest}" ]]; then - echo "Destination directory does not exist. Let's make a new one..." + echo -e "\nDestination directory does not exist. Let's make a new one..." mkdir -p ${dest} fi shift 2 @@ -182,6 +185,27 @@ while [[ $# -gt 0 ]]; do -l|--libadwaita) libadwaita="true" shift + for type in "${@}"; do + case "${type}" in + system) + echo -e "\nUse system default colors for light/dark mode switch." + shift + ;; + fixed) + colortype='fixed' + echo -e "\nUse fixed theme colors but that will break light/dark mode switch." + shift + ;; + -*|--*) + break + ;; + *) + echo -e "\nERROR: Unrecognized type variant '$1'." + echo -e "\nTry '$0 --help' for more information." + exit 1 + ;; + esac + done ;; -c|--color) shift @@ -206,8 +230,8 @@ while [[ $# -gt 0 ]]; do break ;; *) - echo "ERROR: Unrecognized color variant '$1'." - echo "Try '$0 --help' for more information." + echo -e "\nERROR: Unrecognized color variant '$1'." + echo -e "\nTry '$0 --help' for more information." exit 1 ;; esac @@ -262,8 +286,8 @@ while [[ $# -gt 0 ]]; do break ;; *) - echo "ERROR: Unrecognized theme variant '$1'." - echo "Try '$0 --help' for more information." + echo -e "\nERROR: Unrecognized theme variant '$1'." + echo -e "\nTry '$0 --help' for more information." exit 1 ;; esac @@ -286,8 +310,8 @@ while [[ $# -gt 0 ]]; do break ;; *) - echo "ERROR: Unrecognized size variant '${1:-}'." - echo "Try '$0 --help' for more information." + echo -e "\nERROR: Unrecognized size variant '${1:-}'." + echo -e "\nTry '$0 --help' for more information." exit 1 ;; esac @@ -300,25 +324,25 @@ while [[ $# -gt 0 ]]; do nord) colorscheme='true' schemes+=("${SCHEME_VARIANTS[1]}") - echo -e "Nord ColorScheme version! ..." + echo -e "\nNord ColorScheme version! ..." shift ;; dracula) colorscheme='true' schemes+=("${SCHEME_VARIANTS[2]}") - echo -e "Dracula ColorScheme version! ..." + echo -e "\nDracula ColorScheme version! ..." shift ;; gruvbox) colorscheme='true' schemes+=("${SCHEME_VARIANTS[3]}") - echo -e "Gruvbox ColorScheme version! ..." + echo -e "\nGruvbox ColorScheme version! ..." shift ;; everforest) colorscheme='true' schemes+=("${SCHEME_VARIANTS[4]}") - echo -e "Everforest ColorScheme version! ..." + echo -e "\nEverforest ColorScheme version! ..." shift ;; all) @@ -328,31 +352,31 @@ while [[ $# -gt 0 ]]; do ;; black) blackness="true" - echo -e "Blackness version! ..." + echo -e "\nBlackness version! ..." shift ;; rimless) rimless="true" - echo -e "Rimless version! ..." + echo -e "\nRimless version! ..." shift ;; normal) normal="true" window="-Normal" - echo -e "Normal window button version! ..." + echo -e "\nNormal window button version! ..." shift ;; float) float="true" - echo -e "Install Floating Gnome-Shell Panel version! ..." + echo -e "\nInstall Floating Gnome-Shell Panel version! ..." shift ;; -*) break ;; *) - echo "ERROR: Unrecognized tweaks variant '$1'." - echo "Try '$0 --help' for more information." + echo -e "\nERROR: Unrecognized tweaks variant '$1'." + echo -e "\nTry '$0 --help' for more information." exit 1 ;; esac @@ -363,8 +387,8 @@ while [[ $# -gt 0 ]]; do exit 0 ;; *) - echo "ERROR: Unrecognized installation option '$1'." - echo "Try '$0 --help' for more information." + echo -e "\nERROR: Unrecognized installation option '$1'." + echo -e "\nTry '$0 --help' for more information." exit 1 ;; esac @@ -444,6 +468,10 @@ color_schemes() { fi } +color_type() { + sed -i "/\$colortype:/s/system/fixed/" "${SRC_DIR}/sass/_tweaks-temp.scss" +} + blackness_color() { sed -i "/\$blackness:/s/false/true/" "${SRC_DIR}/sass/_tweaks-temp.scss" } @@ -515,6 +543,10 @@ theme_tweaks() { compact_size fi + if [[ "$colortype" = "fixed" ]] ; then + color_type + fi + if [[ "$colorscheme" = "true" ]] ; then color_schemes fi @@ -552,7 +584,7 @@ link_libadwaita() { rm -rf "${HOME}/.config/gtk-4.0/"{assets,gtk.css,gtk-dark.css} - echo -e "\nLink '$THEME_DIR/gtk-4.0' to '${HOME}/.config/gtk-4.0' for libadwaita..." + echo -e "\nLink '${THEME_DIR}/gtk-4.0' to '${HOME}/.config/gtk-4.0' for libadwaita...\n" mkdir -p "${HOME}/.config/gtk-4.0" ln -sf "${THEME_DIR}/gtk-4.0/assets" "${HOME}/.config/gtk-4.0/assets" @@ -572,13 +604,13 @@ libadwaita_theme() { rm -rf "${HOME}/.config/gtk-4.0/"{assets,gtk.css,gtk-dark.css} - echo -e "\nInstalling theme into '${HOME}/.config/gtk-4.0' for libadwaita..." + echo -e "\nInstalling ${2}${3}${4}${5}${6} theme into '${HOME}/.config/gtk-4.0' for libadwaita..." mkdir -p "${HOME}/.config/gtk-4.0" cp -r "${SRC_DIR}/assets/gtk/assets" "${HOME}/.config/gtk-4.0" cp -r "${SRC_DIR}/assets/gtk/symbolics/"*'.svg' "${HOME}/.config/gtk-4.0/assets" - if [[ "$colorscheme" = "true" || "$blackness" = "true" ]] ; then + if [[ "$colorscheme" = "true" || "$blackness" = "true" || "$colortype" = "fixed" ]] ; then sassc $SASSC_OPT "${SRC_DIR}/main/libadwaita/libadwaita${color}.scss" "${HOME}/.config/gtk-4.0/gtk.css" else sassc $SASSC_OPT "${SRC_DIR}/main/libadwaita/libadwaita-Light.scss" "${HOME}/.config/gtk-4.0/gtk.css" @@ -665,7 +697,8 @@ if [[ "$uninstall" == 'true' ]]; then echo && uninstall_theme && uninstall_libadwaita fi else - install_package && tweaks_temp && gnome_shell_version && install_theme + install_package && tweaks_temp + gnome_shell_version && echo && install_theme if [[ "$libadwaita" == 'true' ]]; then uninstall_libadwaita && install_libadwaita diff --git a/src/sass/_tweaks.scss b/src/sass/_tweaks.scss index dcd7d369..c198934b 100644 --- a/src/sass/_tweaks.scss +++ b/src/sass/_tweaks.scss @@ -4,6 +4,9 @@ $colorscheme: 'default'; +// Color type +$colortype: 'system'; // system/fixed : use system colors / use theme colors + // transparent opacity $opacity: 'default'; diff --git a/src/sass/libadwaita/_defaults.scss b/src/sass/libadwaita/_defaults.scss index 0576a2f0..e7be62b5 100644 --- a/src/sass/libadwaita/_defaults.scss +++ b/src/sass/libadwaita/_defaults.scss @@ -8,7 +8,7 @@ // These are the colors apps are can override. We define the defaults here and // define variables for them in _colors.scss -@if $theme != 'default' { +@if $theme != 'default' or $colortype == 'fixed' { // The main accent color and the matching text value @define-color accent_bg_color #{$primary}; @define-color accent_fg_color #{on($primary)}; @@ -33,7 +33,7 @@ @define-color error_fg_color #{on($error)}; @define-color error_color #{$error}; -@if $colorscheme != 'default' or $blackness == 'true' { +@if $colorscheme != 'default' or $blackness == 'true' or $colortype == 'fixed' { // Window @define-color window_bg_color #{$background}; @define-color window_fg_color #{$text}; @@ -45,7 +45,7 @@ // Header bar, search bar, tab bar @define-color headerbar_bg_color #{$titlebar-backdrop}; @define-color headerbar_fg_color #{$titlebar-text}; -@define-color headerbar_border_color #{$border}; +@define-color headerbar_border_color #{$titlebar-text}; @define-color headerbar_backdrop_color #{$titlebar}; @define-color headerbar_shade_color #{if($variant == 'light', transparentize(black, .88), transparentize(black, .64))}; @define-color headerbar_darker_shade_color #{$window-border}; diff --git a/src/sass/libadwaita/widgets/_file-chooser.scss b/src/sass/libadwaita/widgets/_file-chooser.scss index cc5aa65e..e3247533 100644 --- a/src/sass/libadwaita/widgets/_file-chooser.scss +++ b/src/sass/libadwaita/widgets/_file-chooser.scss @@ -81,6 +81,10 @@ placesview { filechooser { box-shadow: 0 1px $border_color; + #pathbarbox { + border-bottom: 1px solid $border_color; + } + // Make the toolbar buttons flat like on an actual toolbar #pathbarbox > stack > box > { button, diff --git a/src/sass/libadwaita/widgets/_tab-view.scss b/src/sass/libadwaita/widgets/_tab-view.scss index 370b8aa9..8f5b61fc 100644 --- a/src/sass/libadwaita/widgets/_tab-view.scss +++ b/src/sass/libadwaita/widgets/_tab-view.scss @@ -20,8 +20,8 @@ tabbar { } tabbox { - padding-bottom: 6px; - padding-top: 6px; + padding-bottom: $base_padding; + padding-top: $base_padding; min-height: 34px; > tabboxchild { @@ -30,8 +30,8 @@ tabbar { } > separator { - margin-top: 3px; - margin-bottom: 3px; + margin-top: 5px; + margin-bottom: 5px; transition: opacity 150ms ease-in-out; &.hidden { @@ -69,7 +69,7 @@ tabbar { .start-action, .end-action { - padding: 6px 5px; + padding: $base_padding; } .start-action:dir(ltr), @@ -110,8 +110,8 @@ tabbar { tabbox, .start-action, .end-action { - padding-top: 3px; - padding-bottom: 3px; + padding-top: 0; + padding-bottom: $base_padding; } } @@ -139,7 +139,7 @@ dnd { margin: 0; min-width: 24px; min-height: 24px; - border-radius: 99px; + border-radius: $circular_radius; } indicator { @@ -159,7 +159,7 @@ tabthumbnail { border-radius: $card_radius + 4px; > box { - margin: 6px; + margin: $base_padding; } &:drop(active) { @@ -178,7 +178,7 @@ tabthumbnail { min-width: 12px; min-height: 12px; border-radius: 8px; - margin: 3px; + margin: $base_padding / 2; box-shadow: 0 1px 2px gtkalpha($accent_color, .4); } } @@ -200,17 +200,17 @@ tabthumbnail { } .icon-title-box { - border-spacing: 6px; + border-spacing: $base_padding; } .tab-unpin-icon { - margin: 6px; + margin: $base_padding; min-width: 24px; min-height: 24px; } button.circular { - margin: 6px; + margin: $base_padding; background-color: gtkalpha($thumbnail_bg_color, .75); min-width: 24px; min-height: 24px; diff --git a/src/sass/libadwaita/widgets/_toolbars.scss b/src/sass/libadwaita/widgets/_toolbars.scss index a03128f3..49e5e5ae 100644 --- a/src/sass/libadwaita/widgets/_toolbars.scss +++ b/src/sass/libadwaita/widgets/_toolbars.scss @@ -74,20 +74,20 @@ } .toolbar { - padding: 6px; - border-spacing: 6px; + padding: $base_padding; + border-spacing: $base_padding; @extend %toolbar; // stand-alone OSD toolbars &.osd { - padding: 12px; + padding: $base_padding * 2; border-radius: $card_radius; } } %toolbar-shrunk { - padding-top: 3px; - padding-bottom: 3px; + padding-top: $base_padding; + padding-bottom: $base_padding; } /**************** @@ -96,7 +96,7 @@ searchbar { > revealer > box { - padding: 6px 6px 7px 6px; + padding: $base_padding $base_padding $base_padding + 1px $base_padding; background-color: $headerbar_backdrop_color; color: $headerbar_fg_color; box-shadow: inset 0 -1px $headerbar_border_color; @@ -141,7 +141,7 @@ searchbar { background-color: transparent; color: inherit; box-shadow: none; - padding-bottom: 6px; + padding-bottom: $base_padding; } %searchbar-inline { @@ -159,8 +159,8 @@ searchbar { } %searchbar-shrunk > revealer > box { - padding-top: 3px; - padding-bottom: 3px; + padding-top: $base_padding; + padding-bottom: $base_padding; } /**************** @@ -171,7 +171,7 @@ actionbar > revealer > box { background-color: $headerbar_backdrop_color; color: $headerbar_fg_color; box-shadow: inset 0 1px $headerbar_border_color; - padding: 7px 6px 6px 6px; + padding: $base_padding + 1px $base_padding $base_padding $base_padding; @extend %toolbar; &, > box.start, > box.end { @@ -207,8 +207,8 @@ actionbar > revealer > box { } %actionbar-shrunk > revealer > box { - padding-top: $base_padding / 2; - padding-bottom: $base_padding / 2; + padding-top: $base_padding; + padding-bottom: $base_padding; } /*************