2023-05-30 22:07:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# gdm-update-display-settings
|
|
|
|
# Copies user's current display settings to GDM's config folder
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2023-06-02 19:52:00 +00:00
|
|
|
# Ensure we're not running as root
|
|
|
|
if [ "${EUID}" == 0 ]; then
|
|
|
|
echo "DO NOT RUN THIS SCRIPT AS ROOT!"
|
|
|
|
echo "Please run this script as a regular user."
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-06-02 12:50:40 +00:00
|
|
|
|
2023-06-02 19:52:00 +00:00
|
|
|
# Update display settings
|
|
|
|
sudo cp ${HOME}/.config/monitors.xml /var/lib/gdm/.config/ && echo "Copied .config/monitors.xml to /var/lib/gdm/.config"
|
|
|
|
|
|
|
|
# Update pointer settings
|
2023-06-02 12:50:40 +00:00
|
|
|
MOUSE_SPEED=$(gsettings get org.gnome.desktop.peripherals.mouse speed)
|
|
|
|
MOUSE_ACCEL_PROFILE=$(gsettings get org.gnome.desktop.peripherals.mouse accel-profile)
|
|
|
|
TOUCHPAD_SPEED=$(gsettings get org.gnome.desktop.peripherals.touchpad speed)
|
|
|
|
TOUCHPAD_ACCEL_PROFILE=$(gsettings get org.gnome.desktop.peripherals.touchpad accel-profile)
|
|
|
|
sudo su -c \
|
|
|
|
"sudo -u gdm dbus-launch gsettings set org.gnome.desktop.peripherals.mouse speed ${MOUSE_SPEED} &&
|
|
|
|
sudo -u gdm dbus-launch gsettings set org.gnome.desktop.peripherals.mouse accel-profile "${MOUSE_ACCEL_PROFILE}" &&
|
|
|
|
sudo -u gdm dbus-launch gsettings set org.gnome.desktop.peripherals.touchpad speed ${TOUCHPAD_SPEED} &&
|
|
|
|
sudo -u gdm dbus-launch gsettings set org.gnome.desktop.peripherals.touchpad accel-profile "${TOUCHPAD_ACCEL_PROFILE}" &&
|
|
|
|
echo Applied pointer speed and acceleration profiles"
|