From 21743fa9b07e20c09cf53c0242a8e442c73ee157 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 2 Nov 2021 10:22:59 +0100 Subject: [PATCH] picom: adapt shadow radius to DPI --- bin/picom-configure | 7 +++++-- dotfiles/picom.conf | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/picom-configure b/bin/picom-configure index a7fb270..8c1f8d7 100755 --- a/bin/picom-configure +++ b/bin/picom-configure @@ -1,11 +1,14 @@ #!/bin/sh -e -DPI=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p') -POLYBAR_HEIGHT=$((20 * DPI / 96)) +dpi=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p') + +POLYBAR_HEIGHT=$((20 * dpi / 96)) +SHADOW_RADIUS=$((12 * dpi / 96)) # Configure picom cat ~/.config/i3/dotfiles/picom.conf \ | sed -e "s/@POLYBAR_HEIGHT@/$POLYBAR_HEIGHT/" \ + | sed -e "s/@SHADOW_RADIUS@/$SHADOW_RADIUS/" \ > $XDG_RUNTIME_DIR/i3/picom.conf.new # Put new configuration file in place diff --git a/dotfiles/picom.conf b/dotfiles/picom.conf index 777da41..eab7f38 100644 --- a/dotfiles/picom.conf +++ b/dotfiles/picom.conf @@ -38,9 +38,9 @@ opacity-rule = [ fade-in-step = 0.08; fade-out-step = 0.08; shadow-opacity = 0.5; -shadow-radius = 10; -shadow-offset-x = -3; -shadow-offset-y = -3; +shadow-radius = @SHADOW_RADIUS@; +shadow-offset-x = 0; +shadow-offset-y = 0; shadow-exclude-reg = "x@POLYBAR_HEIGHT@+0+0" wintypes: {