Compare commits
12 Commits
3a669f0664
...
tio-patch-
Author | SHA1 | Date | |
---|---|---|---|
bd11ec4837 | |||
b6f7ffccba | |||
3c16633482 | |||
17237c513b | |||
5a4ab6f90e | |||
b521a23108 | |||
68321075f6 | |||
b7ff344fe4 | |||
7586338b19 | |||
e1025ea57a | |||
b666bb94db | |||
4054011068 |
4
PKGBUILD
4
PKGBUILD
@@ -1,7 +1,7 @@
|
||||
# Maintainer: TROM <contact@tromsite.com>
|
||||
pkgname=tromjaro-fixes
|
||||
pkgver=1.4.5
|
||||
pkgrel=2
|
||||
pkgver=1.6
|
||||
pkgrel=1
|
||||
pkgdesc="Various fixes for TROMjaro OS"
|
||||
arch=(any)
|
||||
url=""
|
||||
|
@@ -1,14 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the directory paths
|
||||
shared_themes_dir=/usr/share/themes/
|
||||
home_local_themes_dir="$HOME/.local/share/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" ||
|
||||
{ echo "failed to make directoris $target_themes_dir & $home_local_themes_dir"; exit 1; }
|
||||
shared_icons_dir=/usr/share/icons/
|
||||
home_local_icons_dir="$HOME/.local/share/icons/"
|
||||
source_icon_dirs=("$shared_icons_dir" "$home_local_icons_dir")
|
||||
target_icons_dir="$HOME/.icons"
|
||||
|
||||
echo "Set watch for" "${source_theme_dirs[@]}" "directories ..."
|
||||
while inotifywait -qr -e 'modify,attrib,move,move_self,create,delete,delete_self,unmount' "${source_theme_dirs[@]}"; do
|
||||
# Function to synchronize themes and icons from source to target directory
|
||||
sync_themes_and_icons() {
|
||||
rsync -av --delete --progress "${source_theme_dirs[@]}" "$target_themes_dir"
|
||||
echo "Directory $target_themes_dir is synchronized with" "${source_theme_dirs[@]}"
|
||||
rsync -av --delete --progress "${source_icon_dirs[@]}" "$target_icons_dir"
|
||||
echo "Directories $target_themes_dir and $target_icons_dir are synchronized with source directories"
|
||||
}
|
||||
|
||||
# Create the target and local directories if they don't exist
|
||||
mkdir -p "$target_themes_dir" "$home_local_themes_dir" "$target_icons_dir" "$home_local_icons_dir" ||
|
||||
{ echo "failed to make directories $target_themes_dir & $home_local_themes_dir & $target_icons_dir & $home_local_icons_dir"; exit 1; }
|
||||
|
||||
echo "Set watch for theme directories: ${source_theme_dirs[@]}, and icon directories: ${source_icon_dirs[@]}"
|
||||
|
||||
# Start watching for file changes in the source theme and icon directories
|
||||
inotifywait -qmr -e 'modify,attrib,move,move_self,create,delete,delete_self,unmount' "${source_theme_dirs[@]}" "${source_icon_dirs[@]}" |
|
||||
while read -r events; do
|
||||
sync_themes_and_icons
|
||||
done
|
||||
|
@@ -1,15 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
sync_theme() {
|
||||
# Get the current system theme
|
||||
theme=$(xfconf-query -c xsettings -p /Net/ThemeName)
|
||||
# Find the best match for the xfwm4 theme that corresponds with the current system theme
|
||||
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)
|
||||
# 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#/}"
|
||||
# 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"
|
||||
|
||||
# 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() {
|
||||
@@ -22,6 +29,7 @@ sync_font() {
|
||||
sync_theme
|
||||
sync_font
|
||||
|
||||
# Monitor when the user changes their system theme or font in XFCE and sync them as needed
|
||||
while read -r line; do
|
||||
case "$line" in
|
||||
'set: /Net/ThemeName') sync_theme ;;
|
||||
|
@@ -1,2 +1,5 @@
|
||||
[Context]
|
||||
filesystems=~/.themes;
|
||||
filesystems=~/.config/gtk-4.0;~/.themes;~/.icons;xdg-config/gtk-4.0;xdg-config/Kvantum:ro;
|
||||
|
||||
[Environment]
|
||||
QT_STYLE_OVERRIDE=kvantum
|
@@ -14,4 +14,4 @@ export LESS_TERMCAP_us=$'\e[1;32m'
|
||||
export LESS_TERMCAP_ue=$'\e[0m'
|
||||
|
||||
# Disable the beep sound
|
||||
xset b off
|
||||
[ -n "$DISPLAY" ] && xset b off
|
||||
|
Reference in New Issue
Block a user