aboutsummaryrefslogtreecommitdiffstats
path: root/xorg-xrandr/resolution-changed
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-xrandr/resolution-changed')
-rwxr-xr-xxorg-xrandr/resolution-changed20
1 files changed, 20 insertions, 0 deletions
diff --git a/xorg-xrandr/resolution-changed b/xorg-xrandr/resolution-changed
new file mode 100755
index 0000000..a53c7b6
--- /dev/null
+++ b/xorg-xrandr/resolution-changed
@@ -0,0 +1,20 @@
+#!/bin/dash
+
+# Reset rat size in case DPI change modified scaling
+xsetroot -cursor_name left_ptr || :
+
+# Reset rat speed in case DPI changed
+if test "${DESKTOP_SESSION}" = xmonad && test ! "${NO_MATE}" = y; then
+ (exec mate-settings-daemon --replace &) || :
+fi
+
+# Reset background in case resolution change damaged it
+for file in ~/.config/background.${SESSION_} \
+ ~/.config/background.${SESSION} \
+ ~/.config/background.${DESKTOP_SESSION} \
+ ~/.config/background; do
+ if test -r "$file"; then
+ xwallpaper --zoom "$file"
+ (sleep 2 ; xwallpaper --zoom "$file") & # Again, with delay, in case mate-settings-daemon changes it
+ fi
+done