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:
229
nixos/xmonad.nix
229
nixos/xmonad.nix
@@ -92,133 +92,124 @@ 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
|
||||||
# Spring physics animations (mainline picom with spring-physics branch)
|
text = ''
|
||||||
# Syntax: spring(stiffness, dampening, mass) or spring(stiffness, dampening, mass, clamping)
|
# Backend and basic settings
|
||||||
# Set clamping to false for bounce/overshoot effects
|
backend = "glx";
|
||||||
animations = (
|
vsync = ${if config.myModules.xmonad.picom.vSync.enable then "true" else "false"};
|
||||||
# Window move/resize animation with spring physics
|
|
||||||
{
|
|
||||||
triggers = ["geometry"];
|
|
||||||
offset-x = {
|
|
||||||
curve = "spring(250, 20, 1, false)";
|
|
||||||
start = "window-x-before - window-x";
|
|
||||||
end = 0;
|
|
||||||
};
|
|
||||||
offset-y = {
|
|
||||||
curve = "spring(250, 20, 1, false)";
|
|
||||||
start = "window-y-before - window-y";
|
|
||||||
end = 0;
|
|
||||||
};
|
|
||||||
},
|
|
||||||
# Opacity fade animation
|
|
||||||
{
|
|
||||||
triggers = ["open", "show"];
|
|
||||||
opacity = {
|
|
||||||
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
|
||||||
duration = 0.2;
|
|
||||||
start = 0;
|
|
||||||
end = "window-raw-opacity";
|
|
||||||
};
|
|
||||||
scale-x = {
|
|
||||||
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
|
||||||
duration = 0.2;
|
|
||||||
start = 0.9;
|
|
||||||
end = 1;
|
|
||||||
};
|
|
||||||
scale-y = {
|
|
||||||
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
|
||||||
duration = 0.2;
|
|
||||||
start = 0.9;
|
|
||||||
end = 1;
|
|
||||||
};
|
|
||||||
},
|
|
||||||
{
|
|
||||||
triggers = ["close", "hide"];
|
|
||||||
opacity = {
|
|
||||||
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
|
||||||
duration = 0.2;
|
|
||||||
start = "window-raw-opacity";
|
|
||||||
end = 0;
|
|
||||||
};
|
|
||||||
scale-x = {
|
|
||||||
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
|
||||||
duration = 0.2;
|
|
||||||
start = 1;
|
|
||||||
end = 0.9;
|
|
||||||
};
|
|
||||||
scale-y = {
|
|
||||||
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
|
||||||
duration = 0.2;
|
|
||||||
start = 1;
|
|
||||||
end = 0.9;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
'';
|
|
||||||
|
|
||||||
# Wrapper config that includes both home-manager generated config and animations
|
# Spring physics animations (mainline picom with spring-physics branch)
|
||||||
# This works around picom not supporting multiple --config flags
|
# Syntax: spring(stiffness, dampening, mass) or spring(stiffness, dampening, mass, clamping)
|
||||||
# Must use absolute paths since files are symlinks to nix store
|
# Set clamping to false for bounce/overshoot effects
|
||||||
xdg.configFile."picom/picom-with-animations.conf".text = ''
|
animations = (
|
||||||
# Include home-manager generated base config
|
# Window move/resize animation with spring physics
|
||||||
@include "~/.config/picom/picom.conf"
|
{
|
||||||
# Include spring physics animations (uses () list syntax)
|
triggers = ["geometry"];
|
||||||
@include "~/.config/picom/animations.conf"
|
offset-x = {
|
||||||
'';
|
curve = "spring(250, 20, 1, false)";
|
||||||
|
start = "window-x-before - window-x";
|
||||||
|
end = 0;
|
||||||
|
};
|
||||||
|
offset-y = {
|
||||||
|
curve = "spring(250, 20, 1, false)";
|
||||||
|
start = "window-y-before - window-y";
|
||||||
|
end = 0;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
# Opacity fade animation
|
||||||
|
{
|
||||||
|
triggers = ["open", "show"];
|
||||||
|
opacity = {
|
||||||
|
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
||||||
|
duration = 0.2;
|
||||||
|
start = 0;
|
||||||
|
end = "window-raw-opacity";
|
||||||
|
};
|
||||||
|
scale-x = {
|
||||||
|
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
||||||
|
duration = 0.2;
|
||||||
|
start = 0.9;
|
||||||
|
end = 1;
|
||||||
|
};
|
||||||
|
scale-y = {
|
||||||
|
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
||||||
|
duration = 0.2;
|
||||||
|
start = 0.9;
|
||||||
|
end = 1;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
{
|
||||||
|
triggers = ["close", "hide"];
|
||||||
|
opacity = {
|
||||||
|
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
||||||
|
duration = 0.2;
|
||||||
|
start = "window-raw-opacity";
|
||||||
|
end = 0;
|
||||||
|
};
|
||||||
|
scale-x = {
|
||||||
|
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
||||||
|
duration = 0.2;
|
||||||
|
start = 1;
|
||||||
|
end = 0.9;
|
||||||
|
};
|
||||||
|
scale-y = {
|
||||||
|
curve = "cubic-bezier(0.25, 0.1, 0.25, 1)";
|
||||||
|
duration = 0.2;
|
||||||
|
start = 1;
|
||||||
|
end = 0.9;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
# Override picom service to use our wrapper config
|
# Fading
|
||||||
systemd.user.services.picom = {
|
fading = true;
|
||||||
Service.ExecStart = pkgs.lib.mkForce "${pkgs.picom}/bin/picom --config %h/.config/picom/picom-with-animations.conf";
|
fade-in-step = 0.028;
|
||||||
|
fade-out-step = 0.028;
|
||||||
|
|
||||||
|
# Corners
|
||||||
|
corner-radius = 10;
|
||||||
|
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