aboutsummaryrefslogtreecommitdiffstats
path: root/xorg-xrandr/resolution-changed
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
committerMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
commit0f1df0db903ba576fd17b08197d3066af7a61e5f (patch)
treea59c04307b1382257afa3c3512ec3abadf7e0e47 /xorg-xrandr/resolution-changed
parentUse losetup -d instead of --detach and add clean up (diff)
downloaddotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.gz
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.bz2
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.xz
A lot of changes
Signed-off-by: Mattias Andrée <maandree@kth.se>
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