From bb5537c30ae3a861261f5974887635b2cdb301d2 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 12 Dec 2018 06:16:20 -0500 Subject: [PATCH] sxhkd: Add variable DPI support to dropdown.sh This makes the dropdown terminal render properly in both 96 and 192 DPI, as well as any multiples thereof. --- sxhkd/.config/sxhkd/dropdown.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sxhkd/.config/sxhkd/dropdown.sh b/sxhkd/.config/sxhkd/dropdown.sh index d02c566..50cfa18 100755 --- a/sxhkd/.config/sxhkd/dropdown.sh +++ b/sxhkd/.config/sxhkd/dropdown.sh @@ -2,6 +2,9 @@ # New Start: A modern Arch workflow built with an emphasis on functionality. # Copyright (C) 2018 Donovan Glover +DROPDOWN_DPI=$(xrdb -query | grep Xft.dpi | cut -f 2) +DROPDOWN_SCALE=$(($DROPDOWN_DPI / 96)) + c='kitty' # Class i='dropdown' # Instance x='kitty --name' # Executable @@ -10,9 +13,11 @@ x='kitty --name' # Executable # See https://github.com/thestinger/termite/issues/634 for more information. id=$(xdo id -n $i) +rectangle=$((1700 * $DROPDOWN_SCALE))x$((600 * $DROPDOWN_SCALE)) +offset=+$((110 * $DROPDOWN_SCALE))+$((100 * $DROPDOWN_SCALE)) bspc rule -r $c:$i -bspc rule -a $c:$i sticky=on state=floating rectangle=3400x1200+220+200 +bspc rule -a $c:$i sticky=on state=floating rectangle=$rectangle$offset ([ -z "$id" ]) && ($x $i) || ([[ $(xprop -id "$id" | awk '/window state: / {print $3}') == 'Withdrawn' ]] &&