From 352d32624e53c7097435a9815f5fb668b61723aa Mon Sep 17 00:00:00 2001 From: 2387skju <2387skju@users.noreply.github.com> Date: Tue, 21 Oct 2025 23:55:51 +0200 Subject: [PATCH] new post_uninstall.sh: cleanup/reset window-manager to default --- post_uninstall.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 post_uninstall.sh diff --git a/post_uninstall.sh b/post_uninstall.sh new file mode 100755 index 00000000..4cb0e8b9 --- /dev/null +++ b/post_uninstall.sh @@ -0,0 +1,24 @@ +#/!/bin/bash +# post_uninstall script for mate-tweak: reset the window manager +# This will fix: After changing windowmanager and uninstall mate-tweak, you are maybe without any window-manager in mate. + +while read user; do + #has dconf? + sudo -u "$user" -H -s eval 'ls $HOME/.config/dconf 2>> /dev/null > /dev/null' + if [ "${?}" -eq "0" ] + then + wm=$(sudo -u "$user" -H gsettings get org.mate.session.required-components windowmanager | sed s/\'//g) + # echo $wm + if [ "$wm" = "marco-compton" ] || + [ "$wm" = "marco-glx" ] || + [ "$wm" = "marco-no-composite" ] || + [ "$wm" = "marco-picom" ] || + [ "$wm" = "marco-xrender" ] || + [ "$wm" = "marco-xr_glx_hybrid" ] + then + echo "Reset to default window-manager ('marco') for user $user , because $wm was removed." + echo $(sudo -u "$user" -H dbus-run-session gsettings reset org.mate.session.required-components windowmanager) + # echo $(sudo -u "$user" -H gsettings get org.mate.session.required-components windowmanager) + fi + fi +done < <(getent passwd | awk -F ':' '$3>=1000 {print $1}')