Add a script to restart fixes during the package upgrade #2

Closed
eSh wants to merge 3 commits from restart-scripts into main
4 changed files with 10 additions and 1 deletions

View File

@ -1,6 +1,6 @@
# Maintainer: TROM <contact@tromsite.com> # Maintainer: TROM <contact@tromsite.com>
pkgname=tromjaro-fixes pkgname=tromjaro-fixes
pkgver=1.1.1 pkgver=1.2.0
pkgrel=1 pkgrel=1
pkgdesc="Various fixes for TROMjaro OS" pkgdesc="Various fixes for TROMjaro OS"
arch=(any) arch=(any)
@ -12,6 +12,7 @@ depends=('xfce4-appfinder'
provides=('tromjaro-fixes') provides=('tromjaro-fixes')
backup=() backup=()
options=(!strip) options=(!strip)
install=fixes-package.install
prepare() { prepare() {
cp -R ../bin ../flatpak-overrides ../alpm-hooks . cp -R ../bin ../flatpak-overrides ../alpm-hooks .

View File

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
pidof -sq -o %PPID -x "$(basename "$0")" && exit
while :; do while :; do
rm -r ~/.themes/* 2> /dev/null rm -r ~/.themes/* 2> /dev/null
rsync -av --progress /usr/share/themes/* ~/.themes/ --exclude Windowck rsync -av --progress /usr/share/themes/* ~/.themes/ --exclude Windowck

View File

@ -20,6 +20,7 @@ sync_icon_theme() {
sed -i "s/^icon_theme=.*$/icon_theme=$icon_theme/" "$HOME"/.config/qt6ct/qt6ct.conf sed -i "s/^icon_theme=.*$/icon_theme=$icon_theme/" "$HOME"/.config/qt6ct/qt6ct.conf
} }
pidof -sq -o %PPID -x "$(basename "$0")" && exit
while :; do while :; do
# Get the current system theme # Get the current system theme
theme_new=$(xfconf-query -c xsettings -p /Net/ThemeName) theme_new=$(xfconf-query -c xsettings -p /Net/ThemeName)

6
fixes-package.install Normal file
View File

@ -0,0 +1,6 @@
post_upgrade() {
killall -r 'fix-(flatpaks-theming|theming|tweaked-desktop-files)'
eSh marked this conversation as resolved Outdated

Here it might be better to use this command instead:

killall -r 'fix-(flatpaks-theming|theming|tweaked-desktop-files)'
Here it might be better to use this command instead: ```bash killall -r 'fix-(flatpaks-theming|theming|tweaked-desktop-files)' ```
sudo -u "$SUDO_USER" setsid -f fix-tweaked-desktop-files
sudo -u "$SUDO_USER" setsid -f fix-theming
sudo -u "$SUDO_USER" setsid -f fix-flatpaks-theming
eSh marked this conversation as resolved Outdated

If the scripts don't work running as root then try running it like this:

sudo -u "$SUDO_USER" fix-tweaked-desktop-files &
sudo -u "$SUDO_USER" fix-theming &
sudo -u "$SUDO_USER" fix-flatpaks-theming &

Maybe it creates a sub-process under pacman and that causes some issues, so in that case its good to try this one too:

sudo -u "$SUDO_USER" setsid -f fix-tweaked-desktop-files
sudo -u "$SUDO_USER" setsid -f fix-theming
sudo -u "$SUDO_USER" setsid -f fix-flatpaks-theming
If the scripts don't work running as root then try running it like this: ```bash sudo -u "$SUDO_USER" fix-tweaked-desktop-files & sudo -u "$SUDO_USER" fix-theming & sudo -u "$SUDO_USER" fix-flatpaks-theming & ``` Maybe it creates a sub-process under pacman and that causes some issues, so in that case its good to try this one too: ```bash sudo -u "$SUDO_USER" setsid -f fix-tweaked-desktop-files sudo -u "$SUDO_USER" setsid -f fix-theming sudo -u "$SUDO_USER" setsid -f fix-flatpaks-theming ```
}