1
0
forked from extern/nix-config

meta: Add full variable DPI support

This *should* complete the process of adding full variable DPI support
to an X session. The X DPI is now set dynamically and changes on
resolution change, making this setup easy to deploy to both traditional
and HiDPI environments.
This commit is contained in:
Donovan Glover 2018-12-22 17:18:28 -05:00
commit 665c51a356
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
3 changed files with 11 additions and 5 deletions

View File

@ -48,8 +48,12 @@ xset s off -dpms
# Start compton # Start compton
compton -b compton -b
# Start polybar # Start polybar and other things based on DPI
~/.config/polybar/launch.sh main ~/.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 rules
bspc rule -a mpv state=floating bspc rule -a mpv state=floating

View File

@ -5,6 +5,11 @@ HOST_WIDTH=$(bspc query -T -m | jq '.rectangle.width')
CURSOR_THEME=${XCURSOR_THEME:-breeze_cursors} 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 # Determine the DPI based on screen width
if [ "$HOST_WIDTH" -eq "1920" ]; then if [ "$HOST_WIDTH" -eq "1920" ]; then
X_DPI=96 X_DPI=96

View File

@ -1,9 +1,6 @@
! New Start: A modern Arch workflow built with an emphasis on functionality. ! New Start: A modern Arch workflow built with an emphasis on functionality.
! Copyright (C) 2017-2018 Donovan Glover ! 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) ! Make it easier to distinguish between letters (Required for dpi < 300)
Xft.hinting: true Xft.hinting: true