From 3a8558479b20dd9be19e4731b58d0f25ce081dac Mon Sep 17 00:00:00 2001 From: elkowar Date: Sun, 15 Dec 2024 11:47:17 +0100 Subject: [PATCH] Improve niri animation --- eggs/niri/.config/niri/config.kdl | 49 ++++++++++++++++++------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/eggs/niri/.config/niri/config.kdl b/eggs/niri/.config/niri/config.kdl index 4a0c41d..f1e985e 100644 --- a/eggs/niri/.config/niri/config.kdl +++ b/eggs/niri/.config/niri/config.kdl @@ -102,8 +102,11 @@ layout { } -// {# if device.laptop() #} +// {% if device.laptop() %} // spawn-at-startup "bash" "-c" "swayidle -w timeout 601 'niri msg action power-off-monitors' timeout 600 'hyprlock' before-sleep 'hyprlock' timeout 3600 'systemctl suspend' timeout 60000 'systemctl hibernate'" +// spawn-at-startup "waybar" +// {% end %} + spawn-at-startup "bash" "-c" "eww -c ~/.config/eww-bar open-many bar_1 niri_scroller" spawn-at-startup "xwayland-satellite" spawn-at-startup "bash" "-c" "1password --silent" @@ -114,7 +117,6 @@ spawn-at-startup "wl-clip-persist" "--clipboard" "regular" spawn-at-startup "kdeconnect-indicator" // spawn-at-startup "bash" "-c" "swaybg -m fill -i ~/wallpapers/green_leaves.jpg" -spawn-at-startup "waybar" spawn-at-startup "~/.config/niri/clipsync watch with-notifications" spawn-at-startup // @@ -123,35 +125,41 @@ prefer-no-csd screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" animations { + window-movement { + // duration-ms 200 + // curve "ease-out-quad" + spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 + } + horizontal-view-movement { + spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 + } window-open { - duration-ms 200 - curve "ease-out-quad" + spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 + // duration-ms 200 + // curve "ease-out-quad" custom-shader r" float map(float value, float min1, float max1, float min2, float max2) { return min2 + (value - min1) * (max2 - min2) / (max1 - min1); } vec4 open_color(vec3 coords_geo, vec3 size_geo) { float cur = niri_clamped_progress; - if (coords_geo.x > cur) { - return vec4(0.0); - } + if (coords_geo.x > cur) { return vec4(0.0); } vec3 coord = vec3(map(coords_geo.x,0.0, cur, 0.0, 1.0 ), coords_geo.y, coords_geo.z); return texture2D(niri_tex, (niri_geo_to_tex * coord).st); } " } window-close { - duration-ms 200 - curve "ease-out-quad" + spring damping-ratio=1.0 stiffness=800 epsilon=0.0001 + // duration-ms 200 + // curve "ease-out-quad" custom-shader r" float map(float value, float min1, float max1, float min2, float max2) { return min2 + (value - min1) * (max2 - min2) / (max1 - min1); } vec4 close_color(vec3 coords_geo, vec3 size_geo) { float cur = 1.0-niri_clamped_progress; - if (coords_geo.x > cur) { - return vec4(0.0); - } + if (coords_geo.x > cur) { return vec4(0.0); } vec3 coord = vec3(map(coords_geo.x,0.0, cur, 0.0, 1.0), coords_geo.y, coords_geo.z); return texture2D(niri_tex, (niri_geo_to_tex * coord).st); } @@ -164,21 +172,22 @@ window-rule { default-column-width { proportion 0.3333; } } -//layer-rule { - //match namespace="^notifications$" - //block-out-from "screen-capture" -//} +layer-rule { + match namespace="^notifications$" + block-out-from "screen-capture" +} -// Example: block out two password managers from screen capture. -// (This example rule is commented out with a "/-" in front.) window-rule { match app-id=r#"1Password"# match title=r#"[gG]mail"# match title=r#".*[Ww]hats[aA]pp.*$"# - // opacity 0.5 - block-out-from "screen-capture" } +window-rule { + match app-id=r#"^1Password$"# + open-floating true +} + window-rule { match app-id=r#"^[gG]edit$"#;