dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 0e0be97ec7c01ee4a649cb5a9640c96fc54c9603
parent b3c6b12110d977350b1dc2a507a5ddef0c35ad4a
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Wed, 30 Sep 2020 11:09:30 +0200

change Xft configuration based on display setting

Diffstat:
M.Xresources | 4++++
M.Xresources-hidpi | 10+++++-----
M.local/bin/mon | 15+++++++++++++++
3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/.Xresources b/.Xresources @@ -38,9 +38,13 @@ XTerm.vt100.scrollBar: false XTerm.vt100.bellIsUrgent: true xterm*faceName: dina:pixelsize=12:antialias=false +Xft.dpi: 108 Xft.autohint: 0 Xft.lcdfilter: lcddefault Xft.hintstyle: hintfull Xft.hinting: 1 Xft.antialias: 1 Xft.rgba: rgb + +Xcursor.size: 24 +Xcursor.theme: Adwaita diff --git a/.Xresources-hidpi b/.Xresources-hidpi @@ -2,8 +2,8 @@ /* must be loaded after .Xresources */ Xft.dpi: 192 Xcursor.size: 48 -Xcursor.theme: Adwaita -xterm*faceName: DejaVu Sans Mono -xterm*faceSize: 11 -*font: -*-dejavu sans mono-medium-r-normal-*-28-*-*-*-*-*-*-* -*fontList: -*-dejavu sans mono-medium-r-normal-*-28-*-*-*-*-*-*-* +/* Xcursor.theme: Adwaita */ +/* xterm*faceName: DejaVu Sans Mono */ +/* xterm*faceSize: 11 */ +/* *font: -*-dejavu sans mono-medium-r-normal-*-28-*-*-*-*-*-*-* */ +/* *fontList: -*-dejavu sans mono-medium-r-normal-*-28-*-*-*-*-*-*-* */ diff --git a/.local/bin/mon b/.local/bin/mon @@ -4,6 +4,15 @@ if [ -z "$INT" ]; then INT=eDP-1; fi if [ -z "$DPI_INT" ]; then DPI_INT=315; fi if [ -z "$EXT" ]; then EXT=HDMI-1; fi +xrdb_normal() { + xrdb "${HOME}/.Xresources" +} + +xrdb_hidpi() { + xrdb "${HOME}/.Xresources" + xrdb -merge "${HOME}/.Xresources-hidpi" +} + res_from_xrandr() { awk -v disp="$1" ' { @@ -36,12 +45,14 @@ die() { } int() { + xrdb_hidpi xrandr --dpi "${DPI_INT}" --fb "${res_int}" \ --output "${INT}" --mode "${res_int}" --scale 1x1 \ --output "${EXT}" --off } ext() { + xrdb_hidpi xrandr --dpi "${DPI_INT}" --fb "$res_int" \ --output "${INT}" --off \ --output "${EXT}" --mode "${res_ext}" \ @@ -50,6 +61,7 @@ ext() { } ext_native() { + xrdb_normal xrandr --fb "${res_ext}" \ --output "${INT}" --off \ --output "${EXT}" --mode "${res_ext}" \ @@ -58,6 +70,7 @@ ext_native() { } dual() { + xrandr_hidpi xrandr --dpi "${DPI_INT}" \ --fb "$(printf '%d*2\n' "$res_int_x" | bc)x${res_int_y}" \ --output "${INT}" --primary --mode "${res_int}" --scale 1x1 \ @@ -68,6 +81,7 @@ dual() { } mirror() { + xrdb_hidpi xrandr --dpi "${DPI_INT}" \ --fb "${res_int}" \ --output "${INT}" --primary --mode "${res_int}" --scale 1x1 \ @@ -77,6 +91,7 @@ mirror() { } mirror_native() { + xrdb_normal tmp="${EXT}" EXT="${INT}" INT="${tmp}"