10 Commits

Author SHA1 Message Date
ef62c23adc continous checking
The previous script stopped working. Only at times it synced when you were to install a theme. The above code works all the time but uses a constant "checking" of the folders. What do you think about it? Courtesy of chatgpt hahaha
2023-08-03 18:50:55 +02:00
17237c513b a bunch of fixes 2023-08-03 17:06:26 +02:00
5a4ab6f90e roko's changes 2023-08-03 16:42:27 +02:00
b521a23108 simpliffied code plus fix for the libadwaita theming 2023-08-03 16:40:26 +02:00
68321075f6 mor compatibility with the theming 2023-08-03 03:19:16 +02:00
b7ff344fe4 changed 1 icon 2023-08-02 04:49:43 +02:00
7586338b19 tblock icon fix 2023-06-04 16:01:08 +02:00
e1025ea57a bip sound mute improvement 2023-06-04 15:26:45 +02:00
b666bb94db improve the bip sound removal script 2023-06-04 15:26:24 +02:00
4054011068 cleaned and improved thezombie icons fixes by Roko 2023-02-08 13:42:59 +01:00
5 changed files with 53 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
# Maintainer: TROM <contact@tromsite.com> # Maintainer: TROM <contact@tromsite.com>
pkgname=tromjaro-fixes pkgname=tromjaro-fixes
pkgver=1.4.5 pkgver=1.6
pkgrel=2 pkgrel=0
pkgdesc="Various fixes for TROMjaro OS" pkgdesc="Various fixes for TROMjaro OS"
arch=(any) arch=(any)
url="" url=""

View File

@@ -1,14 +1,37 @@
#!/bin/bash #!/bin/bash
# Set the directories
shared_themes_dir=/usr/share/themes/ shared_themes_dir=/usr/share/themes/
home_local_themes_dir="$HOME/.local/share/themes/" local_themes_dir="$HOME/.themes/"
source_theme_dirs=("$shared_themes_dir" "$home_local_themes_dir")
target_themes_dir="$HOME/.themes"
mkdir -p "$target_themes_dir" "$home_local_themes_dir" || # Function to synchronize themes from shared to local directory
{ echo "failed to make directoris $target_themes_dir & $home_local_themes_dir"; exit 1; } sync_themes() {
rsync -av --delete --progress "$shared_themes_dir" "$local_themes_dir"
echo "Directory $local_themes_dir is synchronized with $shared_themes_dir"
}
echo "Set watch for" "${source_theme_dirs[@]}" "directories ..." # Initial synchronization
while inotifywait -qr -e 'modify,attrib,move,move_self,create,delete,delete_self,unmount' "${source_theme_dirs[@]}"; do sync_themes
rsync -av --delete --progress "${source_theme_dirs[@]}" "$target_themes_dir"
echo "Directory $target_themes_dir is synchronized with" "${source_theme_dirs[@]}" # Function to monitor shared themes directory
monitor_shared_themes() {
inotifywait -m -r -e 'modify,attrib,move,move_self,create,delete,delete_self,unmount' "$shared_themes_dir" > /dev/null 2>&1 &
}
# Function to monitor local themes directory
monitor_local_themes() {
inotifywait -m -r -e 'modify,attrib,move,move_self,create,delete,delete_self,unmount' "$local_themes_dir" > /dev/null 2>&1 &
}
# Start monitoring in the background
monitor_shared_themes
monitor_local_themes
# Monitor changes and sync periodically
while true; do
# Wait for a short period (e.g., 5 seconds) before syncing again
sleep 5
# Synchronize if there were changes in either directory
sync_themes
done done

View File

@@ -1,15 +1,22 @@
#!/bin/bash #!/bin/bash
sync_theme() { sync_theme() {
# Get the current system theme # Get the current system theme
theme=$(xfconf-query -c xsettings -p /Net/ThemeName) theme=$(xfconf-query -c xsettings -p /Net/ThemeName)
# Find the best match for the xfwm4 theme that corresponds with the current system theme # Enable syncing the current theme with xfwm4 if not already enabled
xfwm4_theme=$(find /usr/share/themes/ /usr/local/share/themes/ "$HOME"/.themes/ "$HOME"/.local/share/themes/ -mindepth 2 -maxdepth 2 -type d -name xfwm4 -printf '%h\n' 2>/dev/null | grep -o "/${theme}[^/]*$" | sort | head -n1) [ "$(xfconf-query -c xsettings -p /Xfce/SyncThemes)" != 'true' ] && xfconf-query -c xsettings -p /Xfce/SyncThemes -n -t bool -s true
# If a match is not found then use the Default theme
[ -z "$xfwm4_theme" ] && xfwm4_theme='Default'
# Apply the xfwm4 theme
xfconf-query -c xfwm4 -p /general/theme -n -t string -s "${xfwm4_theme#/}"
# Apply the current theme with gsettings # Apply the current theme with gsettings
gsettings set org.gnome.desktop.interface gtk-theme "$theme" gsettings set org.gnome.desktop.interface gtk-theme "$theme"
# Apply the current theme for GTK apps in flatpak
# Define the path to the flatpak override directory
flatpak_override_dir="$HOME/.local/share/flatpak/overrides"
# Create the directory if it doesn't exist
[ -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"
} }
sync_font() { sync_font() {
@@ -22,6 +29,7 @@ sync_font() {
sync_theme sync_theme
sync_font sync_font
# Monitor when the user changes their system theme or font in XFCE and sync them as needed
while read -r line; do while read -r line; do
case "$line" in case "$line" in
'set: /Net/ThemeName') sync_theme ;; 'set: /Net/ThemeName') sync_theme ;;

View File

@@ -1,2 +1,5 @@
[Context] [Context]
filesystems=~/.themes; filesystems=~/.config/gtk-4.0;~/.themes;~/.icons;xdg-config/gtk-4.0;xdg-config/Kvantum:ro;
[Environment]
QT_STYLE_OVERRIDE=kvantum

View File

@@ -14,4 +14,4 @@ export LESS_TERMCAP_us=$'\e[1;32m'
export LESS_TERMCAP_ue=$'\e[0m' export LESS_TERMCAP_ue=$'\e[0m'
# Disable the beep sound # Disable the beep sound
xset b off [ -n "$DISPLAY" ] && xset b off