From 163cf67f081a173b7a2701cc8616dafdd1b97a46 Mon Sep 17 00:00:00 2001 From: vinceliuice Date: Wed, 19 Oct 2022 13:13:06 +0800 Subject: [PATCH] update --- README.md | 74 +++++++++++++++--------------- install.sh | 10 ---- lib-install.sh | 18 +++++--- src/sass/gtk/_common-4.0.scss | 37 ++++++++++++++- src/sass/gtk/apps/_gnome-40.0.scss | 32 +++++++++---- tweaks.sh | 23 +++++++++- 6 files changed, 127 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index cdbaf2c..7b925b0 100644 --- a/README.md +++ b/README.md @@ -91,47 +91,44 @@ Usage: `./install.sh [OPTIONS...]` -b, --background [default|blank|IMAGE_PATH] Set gnome-shell background image. Default is BigSur-like wallpaper - -m, --monterey - Set to MacOS Monterey style. - - -l, --libadwaita - Install gtk-4.0 theme into config for libadwaita. + -m, --monterey + Set to MacOS Monterey style. -N, --nautilus-style [stable|normal|mojave|glassy] Set Nautilus style. Default is BigSur-like style (stabled sidebar) - -HD, --highdefinition + -HD, --highdefinition Set to High Definition size. Default is laptop size - --normal, --normalshowapps + --normal, --normalshowapps Set gnome-shell show apps button style to normal. Default is bigsur - --round, --roundedmaxwindow + --round, --roundedmaxwindow Set maximized window to rounded. Default is square - --right, --rightplacement + --right, --rightplacement Set Nautilus titlebutton placement to right. Default is left - --black, --blackfont + --black, --blackfont Set panel font color to black. Default is white - --darker, --darkercolor - Install darker 'WhiteSur' dark themes. + --darker, --darkercolor + Install darker 'WhiteSur' dark themes. - --nord, --nordcolor - Install 'WhiteSur' Nord ColorScheme themes. + --nord, --nordcolor + Install 'WhiteSur' Nord ColorScheme themes. - --dialog, --interactive - Run this installer interactively, with dialogs. + --dialog, --interactive + Run this installer interactively, with dialogs. - --silent-mode - Meant for developers: ignore any confirm prompt and params become more strict. + --silent-mode + Meant for developers: ignore any confirm prompt and params become more strict. - -r, --remove, -u, --uninstall - Remove all installed WhiteSur themes. + -r, --remove, -u, --uninstall + Remove all installed WhiteSur themes. - -h, --help - Show this help. + -h, --help + Show this help. ``` @@ -201,26 +198,29 @@ Usage: `./tweaks.sh [OPTIONS...]` -f, --firefox [default|monterey] Install 'WhiteSur|Monterey' theme for Firefox and connect it to the current Firefox profiles. Default is WhiteSur - -e, --edit-firefox - Edit 'WhiteSur' theme for Firefox settings and also connect the theme to the current Firefox profiles. + -e, --edit-firefox + Edit 'WhiteSur' theme for Firefox settings and also connect the theme to the current Firefox profiles. - -F, --flatpak - Connect 'WhiteSur' theme to Flatpak. + -F, --flatpak + Connect 'WhiteSur' theme to Flatpak. - -s, --snap - Connect 'WhiteSur' theme the currently installed snap apps. + -s, --snap + Connect 'WhiteSur' theme the currently installed snap apps. -g, --gdm [default|x2] Install 'WhiteSur' theme for GDM (scaling: 100%/200%, default is 100%). Requires to run this shell as root - -d, --dash-to-dock - Fixed Dash to Dock theme issue. + -d, --dash-to-dock + Fixed Dash to Dock theme issue. - -N, --no-darken - Don't darken 'WhiteSur' GDM theme background image. + -N, --no-darken + Don't darken 'WhiteSur' GDM theme background image. - -n, --no-blur - Don't blur 'WhiteSur' GDM theme background image. + -n, --no-blur + Don't blur 'WhiteSur' GDM theme background image. + + -l, --libadwaita + Install gtk-4.0 theme into config for libadwaita. Do not run this option with sudo ! -b, --background [default|blank|IMAGE_PATH] Set 'WhiteSur' GDM theme background image. Default is BigSur-like wallpaper @@ -244,12 +244,12 @@ Usage: `./tweaks.sh [OPTIONS...]` Set 'WhiteSur' GDM (GNOME Shell) 'Activities' icon. Default is 'standard' -r, --remove, --revert - Revert to the original themes, do the opposite things of install and connect. + Revert to the original themes, do the opposite things of install and connect. --silent-mode - Meant for developers: ignore any confirm prompt and params become more strict. + Meant for developers: ignore any confirm prompt and params become more strict. - -h, --help + -h, --help Show this help. ``` diff --git a/install.sh b/install.sh index e63c195..6cb23ea 100755 --- a/install.sh +++ b/install.sh @@ -35,7 +35,6 @@ usage() { helpify "-i, --icon" "[$(IFS='|'; echo "${ICON_VARIANTS[*]}")]" "Set 'Activities' icon" "Default is 'standard'" helpify "-b, --background" "[default|blank|IMAGE_PATH]" "Set gnome-shell background image" "Default is BigSur-like wallpaper" helpify "-m, --monterey" "" "Set to MacOS Monterey style" "" - helpify "-l, --libadwaita" "" "Install gtk-4.0 files to gtk4.0 config folder for libadwaita" "Do not run this option with sudo !" helpify "-N, --nautilus-style" "[$(IFS='|'; echo "${NAUTILUS_STYLE_VARIANTS[*]}")]" "Set Nautilus style" "Default is BigSur-like style (stabled sidebar)" helpify "-HD, --highdefinition" "" "Set to High Definition size" "Default is laptop size" helpify "--normal, --normalshowapps" "" "Set gnome-shell show apps button style to normal" "Default is bigsur" @@ -165,15 +164,6 @@ else echo; install_themes; echo; prompt -s "Done!" - if [[ "${libadwaita}" == 'true' ]]; then - if [[ "$UID" != '0' ]]; then - install_libadwaita - echo; prompt -w "Installed gtk-4.0 into config for libadwaita!" - else - echo; prompt -e "Do not run '--libadwaita' option with sudo!" - fi - fi - if (is_running "xfce4-session"); then msg="XFCE: you may need to run 'xfce4-panel -r' after changing your theme to fix your panel opacity." elif (is_my_distro "solus") && (is_running "gnome-session"); then diff --git a/lib-install.sh b/lib-install.sh index 4bb99fa..9d76ce9 100755 --- a/lib-install.sh +++ b/lib-install.sh @@ -477,12 +477,8 @@ install_theemy() { remove_packy() { rm -rf "${dest}/${name}$(destify ${1})$(destify ${2})$(destify ${3})$(destify ${4})${colorscheme}" - rm -rf "${HOME}/.config/gtk-4.0/"{gtk.css,gtk-dark.css,assets,windows-assets} rm -rf "${dest}/${name}$(destify ${1})${colorscheme}-hdpi" rm -rf "${dest}/${name}$(destify ${1})${colorscheme}-xhdpi" - - # Backward compatibility - # rm -rf "${dest}/${name}$(destify ${1})-mdpi" } remove_old_packy() { @@ -493,7 +489,9 @@ remove_old_packy() { config_gtk4() { local color="$(destify ${1})" - local alt="$(destify ${2})" + local opacity="$(destify ${2})" + local alt="$(destify ${3})" + local theme="$(destify ${4})" local TARGET_DIR="${HOME}/.config/gtk-4.0" @@ -535,8 +533,12 @@ install_themes() { } install_libadwaita() { - gtk_base "${colors[0]}" "${opacities[0]}" "${themes[0]}" "${compact[0]}" - config_gtk4 "${colors[0]}" "${alt[0]}" + gtk_base "${colors[1]}" "${opacities[0]}" "${themes[0]}" + config_gtk4 "${colors[0]}" "${opacities[0]}" "${alts[0]}" "${themes[0]}" +} + +remove_libadwaita() { + rm -rf "${HOME}/.config/gtk-4.0/"{gtk.css,gtk-dark.css,assets,windows-assets} } remove_themes() { @@ -805,6 +807,7 @@ disconnect_snap() { ######################################################################### gtk_base() { + rm -rf "${THEME_SRC_DIR}/sass/_gtk-base-temp.scss" cp -rf "${THEME_SRC_DIR}/sass/_gtk-base"{".scss","-temp.scss"} # Theme base options @@ -826,6 +829,7 @@ gtk_base() { ############################################################################### customize_theme() { + rm -rf "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" cp -rf "${THEME_SRC_DIR}/sass/_theme-options"{".scss","-temp.scss"} # Darker dark colors diff --git a/src/sass/gtk/_common-4.0.scss b/src/sass/gtk/_common-4.0.scss index 80c7ad0..c7d6744 100644 --- a/src/sass/gtk/_common-4.0.scss +++ b/src/sass/gtk/_common-4.0.scss @@ -4256,7 +4256,7 @@ window.dialog.message { // Message Dialog styling padding: ($container_padding - 2px) ($container_padding + 2px); box-shadow: none; border-radius: $bt_radius; - margin: 0 3px 3px 3px; + margin: $container_padding / 2; border: none; &:not(.suggested-action):not(.destructive-action) { @@ -4290,6 +4290,39 @@ window.dialog.message { // Message Dialog styling } } +window.background.messagedialog { + .response-area { + padding: $container_padding; + + button { + min-height: 20px; + padding: ($container_padding - 2px) ($container_padding + 2px); + box-shadow: none; + border-radius: $bt_radius; + margin: $container_padding / 2; + border: none; + + &:not(.suggested-action):not(.destructive-action) { + border-radius: $bt_radius; + background-color: transparent; + + &:hover { + @include button(flat-hover); + transition: $button_transition; + } + + &:active { + @include button(active); + } + } + + &.suggested-action, &.destructive-action { + border-radius: $bt_radius; + } + } + } +} + window.aboutdialog image.large-icons { -gtk-icon-size: 128px; } @@ -4439,7 +4472,7 @@ placessidebar { // Using margins/padding directly in the SidebarRow // will make the animation of the new bookmark row jump > revealer { - padding: 0 $container_padding + 4px; + padding: 0; } image.sidebar-icon { diff --git a/src/sass/gtk/apps/_gnome-40.0.scss b/src/sass/gtk/apps/_gnome-40.0.scss index e9c644b..9a14061 100644 --- a/src/sass/gtk/apps/_gnome-40.0.scss +++ b/src/sass/gtk/apps/_gnome-40.0.scss @@ -3,8 +3,20 @@ * Nautilus * ************/ - .nautilus-window { +.nautilus-window { + &.background.csd { + background-color: transparent; + } + flap.unfolded { + > placessidebar.background { + background: none; + + list.navigation-sidebar { + background-color: $dark_sidebar_bg; + } + } + > separator.horizontal { background-color: $header_border; } @@ -78,7 +90,7 @@ &.current-dir { color: $header_fg; - + &:hover, &:active { background: none; box-shadow: none; @@ -148,7 +160,7 @@ window.background { > contents > toastoverlay > leaflet { > box { background-color: $base_color; - + > headerbar { &, &:backdrop { background: none; @@ -158,7 +170,7 @@ window.background { + separator { @extend %side_separator; - + + box { background-color: $dark_sidebar_bg; } @@ -171,17 +183,17 @@ window.background { list > row textview { padding: $container_padding; border-left: 1px solid $borders_color; - + &, & > text { background: none; } } } - + .current-week { background-color: $fill_color; } - + button.circular.day { border: none; box-shadow: none; @@ -266,13 +278,13 @@ menubutton.flat.popup.sources-button { .small & { border-radius: 0; - + &.forecast-card { border-width: 1px 0; } - + &.display-container { border-width: 0 0 1px 0; } } -} \ No newline at end of file +} diff --git a/tweaks.sh b/tweaks.sh index a79d903..3cc3de6 100755 --- a/tweaks.sh +++ b/tweaks.sh @@ -38,6 +38,7 @@ usage() { helpify "-p, --panel-opacity" "[$(IFS='|'; echo "${PANEL_OPACITY_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM (GNOME Shell) theme panel transparency" "Default is 15%" helpify "-P, --panel-size" "[$(IFS='|'; echo "${PANEL_SIZE_VARIANTS[*]}")]" "Set '${THEME_NAME}' Gnome shell panel height size" "Default is 32px" helpify "-i, --icon" "[$(IFS='|'; echo "${ICON_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM (GNOME Shell) 'Activities' icon" "Default is 'standard'" + helpify "-l, --libadwaita" "" "Install gtk-4.0 files to gtk4.0 config folder for libadwaita" "Do not run this option with sudo !" helpify "-r, --remove, --revert" "" "Revert to the original themes, do the opposite things of install and connect" "" helpify "--silent-mode" "" "Meant for developers: ignore any confirm prompt and params become more strict" "" helpify "-h, --help" "" "Show this help" "" @@ -153,6 +154,8 @@ while [[ $# -gt 0 ]]; do no_darken="true"; shift ;; -n|--no-blur) no_blur="true"; shift ;; + -l|--libadwaita) + libadwaita="true"; shift ;; # Parameters that require value, single use -b|--background) check_param "${1}" "${1}" "${2}" "must" "must" "must" "false" && shift 2 || shift ;; @@ -210,6 +213,15 @@ if [[ "${uninstall}" == 'true' ]]; then remove_firefox_theme prompt -s "Done! '${name}' Firefox theme has been removed."; echo fi + + if [[ "${libadwaita}" == 'true' ]]; then + if [[ "$UID" != '0' ]]; then + remove_libadwaita + prompt -s "Removed gtk-4.0 theme files in '${HOME}/.config/gtk-4.0/' !"; echo + else + prompt -e "Do not run '--libadwaita' option with sudo!"; echo + fi + fi else show_needed_dialogs; customize_theme @@ -255,9 +267,18 @@ else prompt -i "FIREFOX: Anyways, you can also edit 'userChrome.css' and 'customChrome.css' later in your Firefox profile directory." echo fi + + if [[ "${libadwaita}" == 'true' ]]; then + if [[ "$UID" != '0' ]]; then + install_libadwaita + prompt -w "Installed ${name} ${opacities} ${colors} gtk-4.0 into config for libadwaita!"; echo + else + prompt -e "Do not run '--libadwaita' option with sudo!"; echo + fi + fi fi -if [[ "${firefox}" == "false" && "${edit_firefox}" == "false" && "${flatpak}" == "false" && "${snap}" == "false" && "${gdm}" == "false" && "${dash_to_dock}" == "false" ]]; then +if [[ "${firefox}" == "false" && "${edit_firefox}" == "false" && "${flatpak}" == "false" && "${snap}" == "false" && "${gdm}" == "false" && "${dash_to_dock}" == "false" && "${libadwaita}" == "false" ]]; then prompt -e "Oops... there's nothing to tweak..." prompt -i "HINT: Don't forget to define which component to tweak, e.g. '--gdm'" prompt -i "HINT: Run ./tweaks.sh -h for help!..."; echo