From ea5f5373034f124a3a6235fcd276a064c1496cd0 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sun, 23 Oct 2022 11:59:37 +0100 Subject: [PATCH] scripts/dpi: Constant blur/corner-radius scaling Scale picom blur and corner radius according to a constant scale factor much like we do for cursor sizes. This ideally would be defined somewhere centrally, but this is better than nothing. Signed-off-by: Joe Groocock --- picom/picom.conf | 2 +- scripts/dpi | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/picom/picom.conf b/picom/picom.conf index 4e47255..3a08bad 100644 --- a/picom/picom.conf +++ b/picom/picom.conf @@ -38,7 +38,7 @@ opacity-rule = [ blur: { method = "dual_kawase"; - strength = 8; + strength = 12; }; blur-background-frame = true; blur-background-fixed = true; diff --git a/scripts/dpi b/scripts/dpi index a3ff52e..5e33eb2 100755 --- a/scripts/dpi +++ b/scripts/dpi @@ -4,7 +4,9 @@ set -eu # Based on https://github.com/vincentbernat/awesome-configuration/blob/master/bin/xsettingsd-setup CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}" +BLUR_STRENGTH=12 CURSOR_SIZE=28 +CORNER_RADIUS=9 xrdbget() { set -o pipefail @@ -31,8 +33,8 @@ scale=$(( dpi/96 )) cursor=$(( (dpi*CURSOR_SIZE)/96 )) # Update picom scale -sed -i -e "s/strength =.*$/strength = $(( dpi*8/96 ));/" \ - -e "s/corner-radius =.*$/corner-radius = $(( dpi/13 ));/" \ +sed -i -e "s/strength =.*$/strength = $(( (dpi*BLUR_STRENGTH)/96 ));/" \ + -e "s/corner-radius =.*$/corner-radius = $(( (dpi*CORNER_RADIUS)/96 ));/" \ "$CONF_DIR/picom/picom.conf" & # Build xsettingsd.conf