mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-04 07:14:21 +02:00
picom: use a wrapper script to template picom configuration file
This commit is contained in:
parent
9371fff442
commit
3770929742
5 changed files with 20 additions and 5 deletions
13
bin/picom-configure
Executable file
13
bin/picom-configure
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
DPI=$(xrdb -query | sed -nE 's/^Xft\.dpi:\s*//p')
|
||||
POLYBAR_HEIGHT=$((20 * DPI / 96))
|
||||
|
||||
# Configure picom
|
||||
cat ~/.config/i3/dotfiles/picom.conf \
|
||||
| sed -e "s/@POLYBAR_HEIGHT@/$POLYBAR_HEIGHT/" \
|
||||
> $XDG_RUNTIME_DIR/i3/picom.conf.new
|
||||
|
||||
# Put new configuration file in place
|
||||
cmp $XDG_RUNTIME_DIR/i3/picom.conf.new $XDG_RUNTIME_DIR/i3/picom.conf 2> /dev/null || \
|
||||
mv $XDG_RUNTIME_DIR/i3/picom.conf.new $XDG_RUNTIME_DIR/i3/picom.conf
|
|
@ -37,11 +37,11 @@ opacity-rule = [
|
|||
# Shadow and fading
|
||||
fade-in-step = 0.08;
|
||||
fade-out-step = 0.08;
|
||||
shadow-opacity = 0.3;
|
||||
shadow-opacity = 0.5;
|
||||
shadow-radius = 10;
|
||||
shadow-offset-x = -3;
|
||||
shadow-offset-y = -3;
|
||||
xinerama-shadow-crop = false;
|
||||
shadow-exclude-reg = "x@POLYBAR_HEIGHT@+0+0"
|
||||
wintypes:
|
||||
{
|
||||
normal = { shadow = true; };
|
||||
|
|
|
@ -3,5 +3,7 @@ Description=Compositor for X11
|
|||
PartOf=graphical-session.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/picom
|
||||
ExecStartPre=%h/.config/i3/bin/picom-configure
|
||||
ExecStart=/usr/bin/picom --config ${XDG_RUNTIME_DIR}/i3/picom.conf
|
||||
ExecReload=%h/.config/i3/bin/picom-configure
|
||||
Restart=on-failure
|
||||
|
|
|
@ -10,5 +10,6 @@ ExecReload=%h/.config/i3/bin/xsettingsd-setup
|
|||
ExecReload=/usr/bin/kill -HUP $MAINPID
|
||||
# Restart i3 (it uses Xft.dpi)
|
||||
ExecReload=-/usr/bin/i3-msg restart
|
||||
# Restart polybar (it uses an environment variable)
|
||||
# Restart polybar and reload picom (they use an environment variable)
|
||||
ExecReload=/bin/systemctl --user try-restart polybar.service
|
||||
ExecReload=/bin/systemctl --user try-reload picom.service
|
||||
|
|
|
@ -31,7 +31,6 @@ gtk3.css .config/gtk-3.0/gtk.css
|
|||
qt5ct.conf .config/qt5ct/qt5ct.conf
|
||||
systemd .config/systemd/user
|
||||
dunstrc .config/dunst/dunstrc
|
||||
picom.conf .config/picom.conf
|
||||
polybar.conf .config/polybar/config
|
||||
rofi.conf .config/rofi/config.rasi
|
||||
fonts.conf .config/fontconfig/fonts.conf
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue