picom: adapt shadow radius to DPI

This commit is contained in:
Vincent Bernat 2021-11-02 10:22:59 +01:00
parent 3770929742
commit 21743fa9b0
2 changed files with 8 additions and 5 deletions

View file

@ -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

View file

@ -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:
{