Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions post_uninstall.sh
Original file line number Diff line number Diff line change
@@ -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}')