mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-07 16:54:21 +02:00
picom: adapt shadow radius to DPI
This commit is contained in:
parent
3770929742
commit
21743fa9b0
2 changed files with 8 additions and 5 deletions
|
@ -1,11 +1,14 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
DPI=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p')
|
dpi=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p')
|
||||||
POLYBAR_HEIGHT=$((20 * DPI / 96))
|
|
||||||
|
POLYBAR_HEIGHT=$((20 * dpi / 96))
|
||||||
|
SHADOW_RADIUS=$((12 * dpi / 96))
|
||||||
|
|
||||||
# Configure picom
|
# Configure picom
|
||||||
cat ~/.config/i3/dotfiles/picom.conf \
|
cat ~/.config/i3/dotfiles/picom.conf \
|
||||||
| sed -e "s/@POLYBAR_HEIGHT@/$POLYBAR_HEIGHT/" \
|
| sed -e "s/@POLYBAR_HEIGHT@/$POLYBAR_HEIGHT/" \
|
||||||
|
| sed -e "s/@SHADOW_RADIUS@/$SHADOW_RADIUS/" \
|
||||||
> $XDG_RUNTIME_DIR/i3/picom.conf.new
|
> $XDG_RUNTIME_DIR/i3/picom.conf.new
|
||||||
|
|
||||||
# Put new configuration file in place
|
# Put new configuration file in place
|
||||||
|
|
|
@ -38,9 +38,9 @@ opacity-rule = [
|
||||||
fade-in-step = 0.08;
|
fade-in-step = 0.08;
|
||||||
fade-out-step = 0.08;
|
fade-out-step = 0.08;
|
||||||
shadow-opacity = 0.5;
|
shadow-opacity = 0.5;
|
||||||
shadow-radius = 10;
|
shadow-radius = @SHADOW_RADIUS@;
|
||||||
shadow-offset-x = -3;
|
shadow-offset-x = 0;
|
||||||
shadow-offset-y = -3;
|
shadow-offset-y = 0;
|
||||||
shadow-exclude-reg = "x@POLYBAR_HEIGHT@+0+0"
|
shadow-exclude-reg = "x@POLYBAR_HEIGHT@+0+0"
|
||||||
wintypes:
|
wintypes:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue