picom: write complete config directly to fix animations syntax
Give up on @include workarounds - libconfig doesn't support ~. Write the complete picom config directly with correct () list syntax for animations, using xdg.configFile with force=true to override home-manager's generated config. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
105
nixos/xmonad.nix
105
nixos/xmonad.nix
@@ -92,56 +92,23 @@ makeEnable config "myModules.xmonad" true {
|
|||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Disable home-manager's picom config generation - we'll write a complete config
|
||||||
|
# ourselves to work around the libconfig list vs array syntax issue
|
||||||
services.picom = {
|
services.picom = {
|
||||||
enable = true;
|
enable = true;
|
||||||
vSync = config.myModules.xmonad.picom.vSync.enable;
|
vSync = config.myModules.xmonad.picom.vSync.enable;
|
||||||
backend = "glx";
|
backend = "glx";
|
||||||
|
|
||||||
settings = {
|
|
||||||
# Note: animations must use () not [] in libconfig, so we put them in extraArgs
|
|
||||||
# via xdg.configFile below
|
|
||||||
|
|
||||||
fade-in-step = 0.028;
|
|
||||||
fade-out-step = 0.028;
|
|
||||||
fading = true;
|
|
||||||
|
|
||||||
focus-exclude = ["class_g ?= 'rofi'" "class_g ?= 'Steam'"];
|
|
||||||
rounded-corners-exclude = [
|
|
||||||
"! name~=''" # Qtile == empty wm_class..
|
|
||||||
"window_type = 'dock'"
|
|
||||||
"window_type = 'desktop'"
|
|
||||||
"class_g ?= 'Dunst'"
|
|
||||||
];
|
|
||||||
|
|
||||||
corner-radius = 10;
|
|
||||||
round-borders = 0;
|
|
||||||
round-borders-exclude = [
|
|
||||||
"! name~=''" # Qtile == empty wm_class..
|
|
||||||
];
|
|
||||||
|
|
||||||
daemon = false;
|
|
||||||
dbus = false;
|
|
||||||
mark-wmwin-focused = false;
|
|
||||||
mark-ovredir-focused = false;
|
|
||||||
detect-rounded-corners = true;
|
|
||||||
detect-client-opacity = true;
|
|
||||||
|
|
||||||
unredir-if-possible = false;
|
|
||||||
unredir-if-possible-exclude = [];
|
|
||||||
detect-transient = true;
|
|
||||||
detect-client-leader = true;
|
|
||||||
|
|
||||||
invert-color-include = [];
|
|
||||||
glx-no-stencil = true;
|
|
||||||
use-damage = false;
|
|
||||||
transparent-clipping = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Spring physics animations config - written separately because home-manager
|
# Write complete picom config directly to avoid home-manager's libconfig generator
|
||||||
# generates [] (arrays) but picom needs () (lists) for animations
|
# which incorrectly uses [] instead of () for the animations list
|
||||||
# Use @include directive in main config to include this
|
xdg.configFile."picom/picom.conf" = {
|
||||||
xdg.configFile."picom/animations.conf".text = ''
|
force = true; # Override home-manager's generated config
|
||||||
|
text = ''
|
||||||
|
# Backend and basic settings
|
||||||
|
backend = "glx";
|
||||||
|
vsync = ${if config.myModules.xmonad.picom.vSync.enable then "true" else "false"};
|
||||||
|
|
||||||
# Spring physics animations (mainline picom with spring-physics branch)
|
# Spring physics animations (mainline picom with spring-physics branch)
|
||||||
# Syntax: spring(stiffness, dampening, mass) or spring(stiffness, dampening, mass, clamping)
|
# Syntax: spring(stiffness, dampening, mass) or spring(stiffness, dampening, mass, clamping)
|
||||||
# Set clamping to false for bounce/overshoot effects
|
# Set clamping to false for bounce/overshoot effects
|
||||||
@@ -204,21 +171,45 @@ makeEnable config "myModules.xmonad" true {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
'';
|
|
||||||
|
|
||||||
# Wrapper config that includes both home-manager generated config and animations
|
# Fading
|
||||||
# This works around picom not supporting multiple --config flags
|
fading = true;
|
||||||
# Must use absolute paths since files are symlinks to nix store
|
fade-in-step = 0.028;
|
||||||
xdg.configFile."picom/picom-with-animations.conf".text = ''
|
fade-out-step = 0.028;
|
||||||
# Include home-manager generated base config
|
|
||||||
@include "~/.config/picom/picom.conf"
|
|
||||||
# Include spring physics animations (uses () list syntax)
|
|
||||||
@include "~/.config/picom/animations.conf"
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Override picom service to use our wrapper config
|
# Corners
|
||||||
systemd.user.services.picom = {
|
corner-radius = 10;
|
||||||
Service.ExecStart = pkgs.lib.mkForce "${pkgs.picom}/bin/picom --config %h/.config/picom/picom-with-animations.conf";
|
round-borders = 0;
|
||||||
|
rounded-corners-exclude = [
|
||||||
|
"! name~='''",
|
||||||
|
"window_type = 'dock'",
|
||||||
|
"window_type = 'desktop'",
|
||||||
|
"class_g ?= 'Dunst'"
|
||||||
|
];
|
||||||
|
round-borders-exclude = [
|
||||||
|
"! name~='''"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Focus and opacity
|
||||||
|
focus-exclude = ["class_g ?= 'rofi'", "class_g ?= 'Steam'"];
|
||||||
|
invert-color-include = [];
|
||||||
|
|
||||||
|
# Detection
|
||||||
|
detect-rounded-corners = true;
|
||||||
|
detect-client-opacity = true;
|
||||||
|
detect-transient = true;
|
||||||
|
detect-client-leader = true;
|
||||||
|
mark-wmwin-focused = false;
|
||||||
|
mark-ovredir-focused = false;
|
||||||
|
|
||||||
|
# Other settings
|
||||||
|
daemon = false;
|
||||||
|
dbus = false;
|
||||||
|
unredir-if-possible = false;
|
||||||
|
unredir-if-possible-exclude = [];
|
||||||
|
use-damage = false;
|
||||||
|
transparent-clipping = false;
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# systemd.user.services.notifications-tray-icon = {
|
# systemd.user.services.notifications-tray-icon = {
|
||||||
|
|||||||
Reference in New Issue
Block a user