From 2bd257243ac6a2c61dee0140d4859c02c0175978 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Wed, 26 Oct 2022 23:02:34 +0100 Subject: [PATCH] xprofile: Run dpi script on startup Ensures configuration of various graphical services is set correctly on startup, either before they start, or just after, restarting them accordingly. This should scale i3, picom, gtk and friends for a seamless experience. Use xresources as a source of truth for this information. Signed-off-by: Joe Groocock --- X11/xprofile | 4 ++-- scripts/dpi | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/X11/xprofile b/X11/xprofile index 8bd4bde..b7a748d 100644 --- a/X11/xprofile +++ b/X11/xprofile @@ -16,8 +16,8 @@ export MOZ_USE_XINPUT2=1 # enable pixel-accurate scrolling in firefox # Load Xorg resources and set the DPI -xrdb -merge $XDG_CONFIG_HOME/X11/xresources -xrandr --dpi $(xrdb -query | grep -i xft.dpi | cut -d: -f2) +xrdb -merge "$XDG_CONFIG_HOME/X11/xresources" +"$XDG_CONFIG_HOME/scripts/dpi" "$(xrdb -query | grep -i xft.dpi | cut -d: -f2 | xargs)" setxkbmap -option caps:none xset r rate 200 18 diff --git a/scripts/dpi b/scripts/dpi index 896b064..75c94d9 100755 --- a/scripts/dpi +++ b/scripts/dpi @@ -57,13 +57,13 @@ Xft.dpi: $dpi Xcursor.size: $cursor EOF xrandr --dpi "$dpi" & -systemctl --user reload-or-restart xsettingsd & +systemctl --user try-reload-or-restart xsettingsd & wait -systemctl --user reload \ +systemctl --user try-reload-or-restart \ i3 \ polybar@i3bar & -systemctl --user restart \ +systemctl --user try-restart \ dunst & wait