From 5a4ab6f90e7011958d0ae1d65c3434c556cdd78e Mon Sep 17 00:00:00 2001
From: Tio TROM <tio@trom.tf>
Date: Thu, 3 Aug 2023 16:42:27 +0200
Subject: [PATCH] roko's changes

---
 bin/periodic/fix-theming | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/bin/periodic/fix-theming b/bin/periodic/fix-theming
index 4e78559..956a393 100755
--- a/bin/periodic/fix-theming
+++ b/bin/periodic/fix-theming
@@ -3,12 +3,8 @@
 sync_theme() {
 	# Get the current system theme
 	theme=$(xfconf-query -c xsettings -p /Net/ThemeName)
-
-	# Enable syncing the current theme with xfwm4
-	if [ "$(xfconf-query -c xsettings -p /Xfce/SyncThemes)" != 'true' ]; then
-		xfconf-query -c xsettings -p /Xfce/SyncThemes -n -t bool -s true
-	fi
-	
+	# Enable syncing the current theme with xfwm4 if not already enabled
+	[ "$(xfconf-query -c xsettings -p /Xfce/SyncThemes)" != 'true' ] && xfconf-query -c xsettings -p /Xfce/SyncThemes -n -t bool -s true
 	# Apply the current theme with gsettings
 	gsettings set org.gnome.desktop.interface gtk-theme "$theme"
 	
@@ -16,12 +12,8 @@ sync_theme() {
 	
 	# Define the path to the flatpak override directory
 	flatpak_override_dir="$HOME/.local/share/flatpak/overrides"
-	
 	# Create the directory if it doesn't exist
-	if [ ! -d "$flatpak_override_dir" ]; then
-		mkdir -p "$flatpak_override_dir" || { echo 'Failed creating directory!'; return 1; }
-	fi
-	
+	[ -d "$flatpak_override_dir" ] || mkdir -p "$flatpak_override_dir" || { echo 'failed creating directory!'; return 1; }
 	# Write the theme configuration to the global override file
 	echo "[Environment]
 GTK_THEME=$theme" > "$flatpak_override_dir/global"
@@ -30,7 +22,6 @@ GTK_THEME=$theme" > "$flatpak_override_dir/global"
 sync_font() {
 	# Get the current system font
 	font=$(xfconf-query -c xsettings -p /Gtk/FontName)
-	
 	# Apply the same font for the title of xfce windows
 	xfconf-query -c xfwm4 -p /general/title_font -n -t string -s "$font"
 }