Add darker version option

This commit is contained in:
Vince 2021-11-04 11:09:13 +08:00
parent e854df45e8
commit 973da2b566
5 changed files with 49 additions and 37 deletions

View file

@ -41,6 +41,7 @@ usage() {
helpify "--round, --roundedmaxwindow" "" "Set maximized window to rounded" "Default is square"
helpify "--right, --rightplacement" "" "Set Nautilus titlebutton placement to right" "Default is left"
helpify "--black, --blackfont" "" "Set panel font color to black" "Default is white"
helpify "--darker, --darkercolor" "" "Install darker '${THEME_NAME}' dark themes" ""
helpify "--dialog, --interactive" "" "Run this installer interactively, with dialogs" ""
helpify "--silent-mode" "" "Meant for developers: ignore any confirm prompt and params become more strict" ""
helpify "-r, --remove, -u, --uninstall" "" "Remove all installed ${THEME_NAME} themes" ""
@ -66,7 +67,7 @@ while [[ $# -gt 0 ]]; do
# at once
case "${1}" in
# Parameters that don't require value
# Parameters that don't require value
-r|--remove|-u|-uninstall)
uninstall='true'; shift ;;
--silent-mode)
@ -81,11 +82,13 @@ while [[ $# -gt 0 ]]; do
max_round="true"; shift ;;
--black|--blackfont)
black_font="true"; shift ;;
--darker|--darkercolor)
darker="true"; shift ;;
-HD|--highdefinition)
compact="false"; shift ;;
-m|--monterey)
monterey="true"; shift ;;
# Parameters that require value, single use
# Parameters that require value, single use
-b|--background)
check_param "${1}" "${1}" "${2}" "must" "must" "must" "false" && shift 2 || shift ;;
-d|--dest)
@ -140,7 +143,7 @@ else
show_needed_dialogs
fi
prompt -w "Removing the old '${name}' themes..."
prompt -w "Removing the old '${name}' themes... \n"
remove_themes; customize_theme; avoid_variant_duplicates; echo

View file

@ -813,22 +813,10 @@ gtk_base() {
customize_theme() {
cp -rf "${THEME_SRC_DIR}/sass/_theme-options"{".scss","-temp.scss"}
# Change gnome-shell panel transparency
if [[ "${panel_opacity}" != 'default' ]]; then
prompt -s "Changing panel transparency ... \n"
sed $SED_OPT "/\$panel_opacity/s/0.15/0.${panel_opacity}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
# Change gnome-shell panel height size
if [[ "${panel_size}" != 'default' ]]; then
prompt -s "Changing panel height size to '${panel_size}'... \n"
sed $SED_OPT "/\$panel_size/s/default/${panel_size}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
# Change gnome-shell show apps button style
if [[ "${showapps_normal}" == 'true' ]]; then
prompt -s "Changing gnome-shell show apps button style ... \n"
sed $SED_OPT "/\$showapps_button/s/bigsur/normal/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
# Darker dark colors
if [[ "${darker}" == 'true' ]]; then
prompt -s "Changing dark color style to darker one ..."
sed $SED_OPT "/\$darker/s/false/true/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
# Change Nautilus sidarbar size
@ -839,43 +827,61 @@ customize_theme() {
# Change Nautilus style
if [[ "${nautilus_style}" != 'stable' ]]; then
prompt -s "Changing Nautilus style ... \n"
prompt -s "Changing Nautilus style ..."
sed $SED_OPT "/\$nautilus_style/s/stable/${nautilus_style}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
# Change Nautilus titlebutton placement style
if [[ "${right_placement}" == 'true' ]]; then
prompt -s "Changing Nautilus titlebutton placement style ... \n"
prompt -s "Changing Nautilus titlebutton placement style ..."
sed $SED_OPT "/\$placement/s/left/right/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
# Change maximized window radius
if [[ "${max_round}" == 'true' ]]; then
prompt -s "Changing maximized window style ... \n"
prompt -s "Changing maximized window style ..."
sed $SED_OPT "/\$max_window_style/s/square/round/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
# Change gnome-shell panel transparency
if [[ "${panel_opacity}" != 'default' ]]; then
prompt -s "Changing panel transparency ..."
sed $SED_OPT "/\$panel_opacity/s/0.15/0.${panel_opacity}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
# Change gnome-shell panel height size
if [[ "${panel_size}" != 'default' ]]; then
prompt -s "Changing panel height size to '${panel_size}'..."
sed $SED_OPT "/\$panel_size/s/default/${panel_size}/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
# Change gnome-shell show apps button style
if [[ "${showapps_normal}" == 'true' ]]; then
prompt -s "Changing gnome-shell show apps button style ..."
sed $SED_OPT "/\$showapps_button/s/bigsur/normal/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
# Change panel font color
if [[ "${monterey}" == 'true' ]]; then
black_font="true"
prompt -s "Changing to Monterey style ... \n"
prompt -s "Changing to Monterey style ..."
sed $SED_OPT "/\$monterey/s/false/true/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
sed $SED_OPT "/\$panel_opacity/s/0.15/0.5/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
# Change panel font color
if [[ "${black_font}" == 'true' ]]; then
prompt -s "Changing panel font color ... \n"
prompt -s "Changing panel font color ..."
sed $SED_OPT "/\$panel_font/s/white/black/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
if [[ "${compact}" == 'false' ]]; then
prompt -s "Changing Definition mode to HD (Bigger font, Bigger size) ... \n"
prompt -s "Changing Definition mode to HD (Bigger font, Bigger size) ..."
#FIXME: @vince is it not implemented yet? (Only Gnome-shell and Gtk theme finished!)
fi
if [[ "${scale}" == 'x2' ]]; then
prompt -s "Changing GDM scaling to 200% ... \n"
prompt -s "Changing GDM scaling to 200% ..."
sed $SED_OPT "/\$scale/s/default/x2/" "${THEME_SRC_DIR}/sass/_theme-options-temp.scss"
fi
}

View file

@ -10,9 +10,9 @@
@import 'colors-palette';
// Base colors
$base_color: if($variant == 'light', #ffffff, #242424);
$base_color: if($variant == 'light', #ffffff, if($darker == 'true', #1f1f1f, #242424));
$text_color: if($variant == 'light', #363636, #dadada);
$bg_color: if($variant == 'light', #f5f5f5, #333333);
$bg_color: if($variant == 'light', #f5f5f5, if($darker == 'true', #282828, #333333));
$fg_color: if($variant == 'light', #242424, #dedede);
$alt_fg_color: if($variant == 'light', #424242, #afafaf);
$hint_fg_color: if($variant == 'light', #565656, #999999);
@ -102,9 +102,9 @@ $alt_disabled_fg_color: if($variant == 'light', transparentize($alt_
$disabled_bg_color: if($variant == 'light', mix($bg_color, $base_color, 40%), lighten($bg_color, 2%));
// Headerbar colors
$header_bg: if($variant == 'light', #ffffff, #373737);
$header_bg: if($variant == 'light', #ffffff, if($darker == 'true', #1e1e1e, #373737));
$dark_header_bg: if($trans == 'true', rgba($base_color, 0.95), $base_color);
$header_highlight: if($variant == 'dark', #434343, #f5f5f5); // For metacity
$header_highlight: if($variant == 'dark', if($darker == 'true', #242424, #434343), #f5f5f5); // For metacity
$header_bg_backdrop: if($variant == 'light', darken($header_bg, 0%), darken($header_bg, 0%));
$header_border: if($variant == 'light', mix(black, $header_bg, 12%), mix(black, $header_bg, 75%));
@ -123,11 +123,11 @@ $dark_sidebar_bg: white;
}
@if $trans=='true' and $variant=='dark' {
$dark_sidebar_bg: transparentize(#333333, 0.05);
$dark_sidebar_bg: transparentize(if($darker == 'true', #282828, #333333), 0.05);
}
@if $trans=='false' and $variant=='dark' {
$dark_sidebar_bg: #333333;
$dark_sidebar_bg: if($darker == 'true', #282828, #333333);
}
$dark_sidebar_fg: $text_color;
@ -136,7 +136,7 @@ $sidebar_theme_color: if($variant == 'light', rgba(black, 0.12), r
//OSD colors
$osd_fg_color: #dadada;
$osd_bg_color: if($trans=='true', rgba(#2a2a2a, 0.9), #2a2a2a);
$osd_bg_color: if($trans=='true', rgba(if($darker == 'true', #1a1a1a, #2a2a2a), 0.9), if($darker == 'true', #1a1a1a, #2a2a2a));
$osd_button_bg: rgba(lighten($osd_bg_color, 22%), 0.96);
$osd_button_border: $dark_borders_color;
$osd_entry_bg: rgba(lighten($osd_bg_color, 22%), 0.96);
@ -158,7 +158,7 @@ $submenu_bg_color: if($variant == 'light', rgba(white, 1), rgba
@if $trans=='true' { $submenu_bg_color: if($variant == 'light', rgba(white, 0.75), rgba(white, 0.15)); }
// Panel colors
$panel_bg: if($variant == 'light', #f1f1f1, #2a2a2a);
$panel_bg: if($variant == 'light', #f1f1f1, if($darker == 'true', #1f1f1f, #2a2a2a));
@if $trans == 'true' {
$panel_bg: if($variant == 'light', rgba(white, $panel_opacity/2 + 0.08), rgba(black, $panel_opacity));
@ -172,10 +172,10 @@ $panel_fg: if($trans == 'true' and $panel_font == 'whit
$panel_track: if(($trans == 'false' or $panel_font == 'black') and $variant == 'light', rgba(black, 0.15), rgba(white, 0.28));
$panel_divider: if(($trans == 'false' or $panel_font == 'black') and $variant == 'light', rgba(black, 0.08), rgba(white, 0.15));
$dash_bg: if($variant == 'light', rgba(#d1d1d1, $panel_opacity + 0.33), rgba(#222222, $panel_opacity/2 + 0.6));
$dash_bg: if($variant == 'light', rgba(#d1d1d1, $panel_opacity + 0.33), rgba(if($darker == 'true', #1f1f1f, #222222), $panel_opacity/2 + 0.6));
@if $trans == 'true' and $panel_font == 'black' {
$dash_bg: if($variant == 'light', rgba(#d1d1d1, $panel_opacity/2 + 0.08), rgba(#222222, $panel_opacity + 0.15));
$dash_bg: if($variant == 'light', rgba(#d1d1d1, $panel_opacity/2 + 0.08), rgba(if($darker == 'true', #1f1f1f, #222222), $panel_opacity + 0.15));
}
$dash_fg: if($variant == 'light', black, white);

View file

@ -29,5 +29,8 @@ $panel_size: 'default';
// Monterey style
$monterey: 'false';
// Color style
$darker: 'false';
// GDM login dialog scale
$scale: 'default';

View file

@ -28,7 +28,7 @@ usage() {
helpify "-F, --flatpak" "" "Connect '${THEME_NAME}' theme to Flatpak" ""
helpify "-s, --snap" "" "Connect '${THEME_NAME}' theme the currently installed snap apps" ""
helpify "-g, --gdm" "[default|x2]" "Install '${THEME_NAME}' theme for GDM (scaling: 100%/200%, default is 100%)" "Requires to run this shell as root"
helpify "-d, --dash-to-dock" "" "Fixed Dash to Dock theme issue" ""
helpify "-d, --dash-to-dock" "" "Fixed Dash to Dock theme issue" ""
helpify "-N, --no-darken" "" "Don't darken '${THEME_NAME}' GDM theme background image" ""
helpify "-n, --no-blur" "" "Don't blur '${THEME_NAME}' GDM theme background image" ""
helpify "-b, --background" "[default|blank|IMAGE_PATH]" "Set '${THEME_NAME}' GDM theme background image" "Default is BigSur-like wallpaper"