I switched to Manjaro 20.2 GNOME and I am facing a issue when trying to run a script on external monitor connect/disconnect event in udev. In popos this script was working fine, and it seems like the udev triggering is working, but the gsettings command is not working.
The issue is the following - when running gsettings set org.gnome.desktop.interface text-scaling-factor 1.14 in PopOS (previous distro) the accessibility option in the top bar is shown and it instantly scales the text as it should. In Manjaro it does nothing. When i check for the value with gsettings get org.gnome.desktop.interface text-scaling-factor it returns 1.13999 but the changes do not reflect in UI or when looking in dconf-editor, which still show 1.0.
In addition, when changing the value in tweak-tools or in dconf-editor, the UI instatnly scales accordingly but when re-toggling the scaling using the slider in the top panel menu, then it resets to 1.25 not 1.14 as I've set it before or as gsettings get returns. To make it clear, after retoggling the "Large text" dconf-editor shows the value to be 1.25 but gsettings get still shows 1.13999.
Though it is somewhat irrelevant to the issue by now, here is the script which uses the dbus socket to run gsettings:
# rule in /etc/udev/rules.d/text_scale.rules:
# SUBSYSTEM=="drm", ACTION=="change", RUN+="/home/user/.bin/scale_text"
# Need to run 'gsettings' as user, so lets get the user id
# Get the Real Username
RUID=$(who | awk 'FNR == 1 {print $1}')
# Translate Real Username to Real User ID
RUSER_UID="$(id -u ${RUID})"
# Get the current text-scaling-factor
CURRENT_FACTOR=$(sudo -u ${RUID} \
DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/${RUSER_UID}/bus" \
gsettings get org.gnome.desktop.interface text-scaling-factor)
if (( $(echo "$CURRENT_FACTOR == 1.0" | bc -l) ))
then
sudo -u ${RUID} DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/${RUSER_UID}/bus" \
gsettings set org.gnome.desktop.interface text-scaling-factor 1.14
else
sudo -u ${RUID} DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/${RUSER_UID}/bus" \
gsettings reset org.gnome.desktop.interface text-scaling-factor
fi