1
opensuse-setup/scripts/gdm-update-display-settings

22 lines
1.2 KiB
Plaintext
Raw Normal View History

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
#
################################################################################
sudo cp .config/monitors.xml /var/lib/gdm/.config/ && echo "Copied .config/monitors.xml to /var/lib/gdm/.config"
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"