commit 279382028420a63825f95d48f9bd31831d0d0c28 from: the xhr date: Wed Jun 01 10:00:03 2022 UTC Suck in correct i3conf for HiDPI and use host specific i3status.conf commit - 5e74f91151863b7c44199e024a08f496d6b731bb commit + 279382028420a63825f95d48f9bd31831d0d0c28 blob - 74921610e3fbe6fbf9eeabb0411278dffaabc666 blob + 29c9ff0f34a9ea55e56ae1623bef72976c3595f7 --- .xinitrc-openbsd +++ .xinitrc-openbsd @@ -17,9 +17,54 @@ for m in /usr/local/share/fonts/*; do fi done -# merge Xresources file -[[ -e ~/.Xresources ]] && xrdb -merge ~/.Xresources & +HIGHDPI=0 +xrandr | grep -w connected | grep 2880 > /dev/null +if [ $? -eq 0 ]; then + # We have a high DPI monitor connected + HIGHDPI=1 +fi +export HIGHDPI + + +# HiDPI case +if [ $HIGHDPI -eq 1 ]; then + [[ -e ~/.Xresources-high ]] && xrdb -merge ~/.Xresources-high & + + _cpath=~/.i3/config + if [[ -h ${_cpath} ]]; then + rm ${_cpath} + ln -s ${_cpath}.high ${_cpath} + fi + + _apath=~/.i3/autostart + if [[ -h ${_apath} ]]; then + rm ${_apath} + ln -s ${_apath}.high ${_apath} + fi +else + [[ -e ~/.Xresources ]] && xrdb -merge ~/.Xresources & + + _cpath=~/.i3/config + if [[ -h ${_cpath} ]]; then + rm ${_cpath} + ln -s ${_cpath}.low ${_cpath} + fi + + _apath=~/.i3/autostart + if [[ -h ${_apath} ]]; then + rm ${_apath} + ln -s ${_apath}.low ${_apath} + fi +fi + +# Link host specific i3status config +_apath=~/.i3status.conf +if [[ -h ${_apath} ]]; then + rm ${_apath} + ln -s ~/Documents/git/config/.i3status.conf.$(hostname -s) ${_apath} +fi + [[ -e ~/.profile ]] && . ~/.profile & export LC_CTYPE=en_US.UTF-8