From 8d854d88d4e37b25ee269d77719b151a6f3fcc2a Mon Sep 17 00:00:00 2001 From: paperbenni Date: Mon, 3 Aug 2020 19:33:27 +0200 Subject: [PATCH] add instantdpi --- autostart.sh | 5 ++++- programs/instantdpi | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100755 programs/instantdpi diff --git a/autostart.sh b/autostart.sh index 5f3d4e5..a66ad9e 100755 --- a/autostart.sh +++ b/autostart.sh @@ -275,7 +275,10 @@ if ! iconf -i nostatus; then source /usr/bin/instantstatus & fi -iconf -i potato || ipicom & +# compositing +if iconf -i potato || iconf -i nocompositing; then + ipicom & +fi while :; do lxpolkit diff --git a/programs/instantdpi b/programs/instantdpi new file mode 100755 index 0000000..aaa7d6f --- /dev/null +++ b/programs/instantdpi @@ -0,0 +1,39 @@ +#!/bin/bash + +# apply instantOS dpi settings + +DPI="$(iconf dpi)" + +resetdpi() { + echo "resetting dpi" + sed -i '/^Xft\.dpi/d' ~/.Xresources +} + +appendresources() { + echo "setting dpi to $DPI" + echo "Xft.dpi: $DPI" >>~/.Xresources +} + +if [ -z "$DPI" ]; then + resetdpi + exit +fi + +[ "$DPI" -eq "$DPI" ] || exit + +# resetting +if [ "$DPI" = "96" ]; then + resetdpi + exit +fi + +if ! [ -e .Xresources ]; then + echo "initializing xresources" + touch ~/.Xresources + appendresources "$DPI" +else + if grep -q '^Xft.dpi' ~/.Xresources; then + resetdpi + fi + appendresources "$DPI" +fi -- 2.11.0