Compare commits

..

No commits in common. "fb1c5507682631c66eebae7c38f8b385e8aa9bc5" and "b741df884e617a956a097391913070c718cccc8c" have entirely different histories.

View File

@ -71,27 +71,22 @@ set_xfwm_theme() {
# Use the highDPI variant of the XFWM theme # Use the highDPI variant of the XFWM theme
use_hdpi_theme_variant() { use_hdpi_theme_variant() {
# shellcheck disable=SC2015 local -r current_xfwm_theme=$(xfconf-query -c xfwm4 -p /general/theme)
[ -n "$1" ] && local -r xfwm_theme="$1" ||
local -r xfwm_theme=$(xfconf-query -c xfwm4 -p /general/theme)
for variant in xhdpi hdpi; do for variant in xhdpi hdpi; do
# If this variant of the theme is already enabled then break out of the loop # If this variant of the theme is already enabled then break out of the loop
[ "${xfwm_theme##*-}" = "$variant" ] && break [ "${current_xfwm_theme##*-}" = "$variant" ] && break
# Store the name for this variant of the theme in highDPI_theme variable # Store the name for this variant of the theme in highDPI_theme variable
local highDPI_theme=$xfwm_theme-$variant local -r highDPI_theme=$current_xfwm_theme-$variant
if theme_exists "$highDPI_theme"; then if theme_exists "$highDPI_theme"; then
set_xfwm_theme "$highDPI_theme" set_xfwm_theme "$highDPI_theme"
[ -z "$1" ] && [ "$1" != 'disable_notification' ] &&
notify-send "XFWM theme changed to $highDPI_theme" "Changed to the highDPI variant of your chosen theme because you've enabled highDPI on your system" notify-send "XFWM theme changed to $highDPI_theme" "Changed to the highDPI variant of your chosen theme because you've enabled highDPI on your system"
break break
fi fi
done done
if ! theme_exists "$highDPI_theme"; then
[ -n "$1" ] && theme_exists "$1" && set_xfwm_theme "$1"
fi
} }
# Use the normal variant of the XFWM theme # Use the normal variant of the XFWM theme
@ -103,7 +98,7 @@ use_normal_theme_variant() {
[ "${current_xfwm_theme##*-}" != "$variant" ] && continue [ "${current_xfwm_theme##*-}" != "$variant" ] && continue
# Store the name for the normal variant of this theme in normal_theme variable # Store the name for the normal variant of this theme in normal_theme variable
local normal_theme=${current_xfwm_theme%-"$variant"} local -r normal_theme=${current_xfwm_theme%-"$variant"}
if theme_exists "$normal_theme"; then if theme_exists "$normal_theme"; then
set_xfwm_theme "$normal_theme" set_xfwm_theme "$normal_theme"
@ -161,12 +156,10 @@ sync_theme() {
# Apply the current theme for XFWM unless it's initial_sync on system reboot # Apply the current theme for XFWM unless it's initial_sync on system reboot
if [ "$1" != 'initial_sync' ]; then if [ "$1" != 'initial_sync' ]; then
set_xfwm_theme "$current_theme"
# Use the highDPI variant of the XFWM theme if the current_window_scaling factor is 2 # Use the highDPI variant of the XFWM theme if the current_window_scaling factor is 2
if [ "$current_window_scaling" -eq '2' ]; then [ "$current_window_scaling" -eq '2' ] && use_hdpi_theme_variant 'disable_notification'
use_hdpi_theme_variant "$current_theme"
else
set_xfwm_theme "$current_theme"
fi
fi fi
# Cleanup flatpak_themes_dir and remove ~/.config/gtk-4.0 # Cleanup flatpak_themes_dir and remove ~/.config/gtk-4.0