diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc index 0bf78395..66ecdcf4 100755 --- a/bspwm/.config/bspwm/bspwmrc +++ b/bspwm/.config/bspwm/bspwmrc @@ -48,8 +48,12 @@ xset s off -dpms # Start compton compton -b -# Start polybar -~/.config/polybar/launch.sh main +# Start polybar and other things based on DPI +~/.config/xeventbind/on-resolution-change.sh + +if hash xeventbind 2>/dev/null; then + xeventbind resolution $HOME/.config/xeventbind/on-resolution-change.sh & +fi # bspc rules bspc rule -a mpv state=floating diff --git a/xeventbind/.config/xeventbind/on-resolution-change.sh b/xeventbind/.config/xeventbind/on-resolution-change.sh index 3a65d0e3..5a61b4d6 100755 --- a/xeventbind/.config/xeventbind/on-resolution-change.sh +++ b/xeventbind/.config/xeventbind/on-resolution-change.sh @@ -5,6 +5,11 @@ HOST_WIDTH=$(bspc query -T -m | jq '.rectangle.width') CURSOR_THEME=${XCURSOR_THEME:-breeze_cursors} +# If the DPI is not set, set it to 96 by default +if [ -z "$(xrdb -query | grep dpi)" ]; then + X_DPI=96 +fi + # Determine the DPI based on screen width if [ "$HOST_WIDTH" -eq "1920" ]; then X_DPI=96 diff --git a/xresources/.Xresources b/xresources/.Xresources index a01a45b2..1631c22d 100644 --- a/xresources/.Xresources +++ b/xresources/.Xresources @@ -1,9 +1,6 @@ ! New Start: A modern Arch workflow built with an emphasis on functionality. ! Copyright (C) 2017-2018 Donovan Glover -! Use 2x (192/96) scaling for 4k (Effectively 1920x1080) -Xft.dpi: 192 - ! Make it easier to distinguish between letters (Required for dpi < 300) Xft.hinting: true