Created
May 30, 2020 15:29
-
-
Save gionn/2d4cf853bf6889a8674dce5628d89b72 to your computer and use it in GitHub Desktop.
i3 automatic HiDPI on login when external monitor is detected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ $GDMSESSION == 'i3' ]]; then | |
# detect if external hidpi monitor is connected | |
if xrandr | grep 'DP1 connected 3840' > /dev/null; then | |
# https://wiki.archlinux.org/index.php/HiDPI | |
export GDK_SCALE=2 | |
export GDK_DPI_SCALE=0.5 | |
xrdb -merge ~/.Xresources.hidpi | |
# disable internal laptop monitor | |
xrandr --output eDP1 --off | |
fi | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Xft.dpi: 192 | |
! These might also be useful depending on your monitor and personal preference: | |
Xft.autohint: 0 | |
Xft.lcdfilter: lcddefault | |
Xft.hintstyle: hintfull | |
Xft.hinting: 1 | |
Xft.antialias: 1 | |
Xft.rgba: rgb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Gionn !
I think I might use a part of your solution as an answer to my issue : adjusting dpi for i3 with no impact on xfce.
The thing is I use SLIM instead of gdm, so I imagine there is an equivalent of
$GDMSESSION
that I could write to make it work. Something more generic or in the contrary specific to SLIM.Would you know about that ? Thank you !
PierreP