From 100a23fb037a67473e4f5e1992637e9a7f5897e8 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 2 Nov 2021 13:29:31 +0100 Subject: [PATCH] picom: compute an offset for shadows --- bin/picom-configure | 2 ++ dotfiles/picom.conf | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/picom-configure b/bin/picom-configure index 8c1f8d7..eee1bc2 100755 --- a/bin/picom-configure +++ b/bin/picom-configure @@ -4,11 +4,13 @@ dpi=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p') POLYBAR_HEIGHT=$((20 * dpi / 96)) SHADOW_RADIUS=$((12 * dpi / 96)) +SHADOW_OFFSET=$((SHADOW_RADIUS*2/3)) # Configure picom cat ~/.config/i3/dotfiles/picom.conf \ | sed -e "s/@POLYBAR_HEIGHT@/$POLYBAR_HEIGHT/" \ | sed -e "s/@SHADOW_RADIUS@/$SHADOW_RADIUS/" \ + | sed -e "s/@SHADOW_OFFSET@/$SHADOW_OFFSET/" \ > $XDG_RUNTIME_DIR/i3/picom.conf.new # Put new configuration file in place diff --git a/dotfiles/picom.conf b/dotfiles/picom.conf index b412330..c498455 100644 --- a/dotfiles/picom.conf +++ b/dotfiles/picom.conf @@ -37,10 +37,10 @@ opacity-rule = [ # Shadow and fading fade-in-step = 0.08; fade-out-step = 0.08; -shadow-opacity = 0.5; +shadow-opacity = 1; shadow-radius = @SHADOW_RADIUS@; -shadow-offset-x = 0; -shadow-offset-y = 0; +shadow-offset-x = -@SHADOW_OFFSET@; +shadow-offset-y = -@SHADOW_OFFSET@; shadow-exclude-reg = "x@POLYBAR_HEIGHT@+0+0" wintypes: {