This commit is contained in:
vinceliuice 2022-10-19 18:03:26 +08:00
parent 326a1b1e6e
commit 5dd4b101d5
4 changed files with 95 additions and 55 deletions

View file

@ -132,10 +132,19 @@ finalize_argument_parsing
#---------------------------START INSTALL THEMES-------------------------------#
if [[ "${uninstall}" == 'true' ]]; then
prompt -i "Removing '${name}' gtk themes in '${dest}'... \n"
prompt -w "REMOVAL: Non file-related parameters will be ignored. \n"
remove_themes
prompt -s "Done! All '${name}' gtk themes in has been removed."
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
else
prompt -i "Removing '${name}' gtk themes in '${dest}'... \n"
prompt -w "REMOVAL: Non file-related parameters will be ignored. \n"
remove_themes
prompt -s "Done! All '${name}' gtk themes in has been removed."
fi
if [[ -f "${MISC_GR_FILE}.bak" ]]; then
prompt -e "Find installed GDM theme, you need to run: 'sudo ./tweaks.sh -g -r' to remove it!"
@ -164,6 +173,15 @@ else
echo; install_themes; echo; prompt -s "Done!"
if [[ "${libadwaita}" == 'true' ]]; then
if [[ "$UID" != '0' ]]; then
install_libadwaita
echo; prompt -w "Installed ${name} ${opacities} ${colors} gtk-4.0 theme in '${HOME}/.config/gtk-4.0' 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

View file

@ -487,8 +487,12 @@ remove_old_packy() {
rm -rf "${dest}/${name}${1}${5}-xhdpi"
}
###############################################################################
# LIBADWAITA #
###############################################################################
config_gtk4() {
local acolor="$(destify ${1})"
local color="$(destify ${1})"
local alt="$(destify ${2})"
local TARGET_DIR="${HOME}/.config/gtk-4.0"
@ -496,7 +500,7 @@ config_gtk4() {
# Install gtk4.0 into config for libadwaita
mkdir -p "${TARGET_DIR}"
rm -rf "${TARGET_DIR}/"{gtk.css,gtk-dark.css,assets,windows-assets}
sassc ${SASSC_OPT} "${THEME_SRC_DIR}/main/gtk-4.0/gtk${acolor}.scss" "${TARGET_DIR}/gtk.css"
sassc ${SASSC_OPT} "${THEME_SRC_DIR}/main/gtk-4.0/gtk${color}.scss" "${TARGET_DIR}/gtk.css"
sassc ${SASSC_OPT} "${THEME_SRC_DIR}/main/gtk-4.0/gtk-Dark.scss" "${TARGET_DIR}/gtk-dark.css"
cp -r "${THEME_SRC_DIR}/assets/gtk/common-assets/assets" "${TARGET_DIR}"
cp -r "${THEME_SRC_DIR}/assets/gtk/common-assets/sidebar-assets/"*".png" "${TARGET_DIR}/assets"
@ -504,6 +508,18 @@ config_gtk4() {
cp -r "${THEME_SRC_DIR}/assets/gtk/windows-assets/titlebutton${alt}${colorscheme}" "${TARGET_DIR}/windows-assets"
}
install_libadwaita() {
opacity="${opacities[0]}"
color="${colors[1]}"
gtk_base "${opacities[0]}" "${themes[0]}"
config_gtk4 "${colors}" "${alts}"
}
remove_libadwaita() {
rm -rf "${HOME}/.config/gtk-4.0/"{gtk.css,gtk-dark.css,assets,windows-assets}
}
###############################################################################
# THEMES #
###############################################################################
@ -530,25 +546,6 @@ install_themes() {
stop_animation
}
install_libadwaita() {
gtk_base "${opacities[0]}" "${themes[0]}"
color="${colors[1]}"
acolor='Dark'
if [[ ${color} == '' ]]; then
acolor='Light'
else
acolor='Dark'
fi
config_gtk4 "${acolor}" "${alts}"
}
remove_libadwaita() {
rm -rf "${HOME}/.config/gtk-4.0/"{gtk.css,gtk-dark.css,assets,windows-assets}
}
remove_themes() {
process_ids=()

View file

@ -3,9 +3,49 @@
* Nautilus *
************/
$nautilus_header_image: image($header_bg);
$nautilus_header_borders_image: image($header_border);
$nautilus_borders_color: if($variant=='light', darken(rgba($dark_sidebar_bg, 1), 12%), $header_border);
$flap_sidebar_size: 240px;
@if $nautilus_style == 'stable' {
$nautilus_header_image: linear-gradient(90deg, $dark_sidebar_bg $flap_sidebar_size,
$nautilus_borders_color $flap_sidebar_size,
$nautilus_borders_color ($flap_sidebar_size + 1px),
$base_color ($flap_sidebar_size + 1px));
$nautilus_header_borders_image: linear-gradient(90deg, transparent $flap_sidebar_size,
$header_border $flap_sidebar_size);
}
@if $nautilus_style == 'glassy' {
$nautilus_header_image: linear-gradient(90deg, $dark_sidebar_bg ($flap_sidebar_size / 2),
$dark_header_bg 40%);
$nautilus_header_borders_image: linear-gradient(90deg, rgba($header_border, 0) (($flap_sidebar_size / 2) - 40px),
$header_border 40%);
}
.nautilus-window {
&.background.csd {
background-color: transparent;
@if $nautilus_style == 'stable' or $nautilus_style == 'glassy' {
&.background.csd {
background-color: transparent;
headerbar {
background-color: transparent;
border: none;
background-image: $nautilus_header_image;
border-image: $nautilus_header_borders_image 0 0 1 / 0px 0px 1px stretch;
}
}
}
@if $nautilus_style == 'stable' {
headerbar {
box.start > box {
margin-left: 144px;
}
}
}
flap.unfolded {

View file

@ -23,22 +23,25 @@ usage() {
# Please specify their default value manually, some of them are come from _variables.scss
# You also have to check and update them regurally
helpify_title
helpify "-f, --firefox" "[default|monterey|alt]" "Install '${THEME_NAME}|Monterey|Alt' theme for Firefox and connect it to the current Firefox profiles" "Default is ${THEME_NAME}"
helpify "-e, --edit-firefox" "" "Edit '${THEME_NAME}' theme for Firefox settings and also connect the theme to the current Firefox profiles" ""
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 "-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"
helpify "-o, --opacity" "[$(IFS='|'; echo "${OPACITY_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM theme opacity variants" "Default is 'normal'"
helpify "-c, --color" "[$(IFS='|'; echo "${COLOR_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM and Dash to Dock theme color variants" "Default is 'light'"
helpify "-t, --theme" "[$(IFS='|'; echo "${THEME_VARIANTS[*]}")]" "Set '${THEME_NAME}' GDM theme accent color" "Default is BigSur-like theme"
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 "-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"
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 "--nord, --nordcolor" "" "Install '${THEME_NAME}' Nord ColorScheme themes" ""
helpify "-f, --firefox" "[default|monterey|alt]" "Install '${THEME_NAME}|Monterey|Alt' theme for Firefox and connect it to the current Firefox profiles" "Default is ${THEME_NAME}"
helpify "-e, --edit-firefox" "" "Edit '${THEME_NAME}' theme for Firefox settings and also connect the theme to the current Firefox profiles" ""
helpify "-F, --flatpak" "" "Connect '${THEME_NAME}' theme to Flatpak" ""
helpify "-s, --snap" "" "Connect '${THEME_NAME}' theme the currently installed snap apps" ""
helpify "-d, --dash-to-dock" "" "Fixed Dash to Dock theme issue" ""
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" ""
@ -213,15 +216,6 @@ 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
@ -267,15 +261,6 @@ 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} ${acolor} gtk-4.0 theme in '${HOME}/.config/gtk-4.0' 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" && "${libadwaita}" == "false" ]]; then