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