update flakes; use swww for backdrop; add gemini-cli

This commit is contained in:
EdenQwQ 2025-06-28 00:32:59 +08:00
parent e60f4cafb4
commit cb592edb42
13 changed files with 267 additions and 242 deletions

156
flake.lock generated
View file

@ -8,11 +8,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1747575206,
"narHash": "sha256-NwmAFuDUO/PFcgaGGr4j3ozG9Pe5hZ/ogitWhY+D81k=",
"lastModified": 1750173260,
"narHash": "sha256-9P1FziAwl5+3edkfFcr5HeGtQUtrSdk/MksX39GieoA=",
"owner": "ryantm",
"repo": "agenix",
"rev": "4835b1dc898959d8547a871ef484930675cb47f1",
"rev": "531beac616433bac6f9e2a19feb8e99a22a66baf",
"type": "github"
},
"original": {
@ -467,11 +467,11 @@
]
},
"locked": {
"lastModified": 1749944797,
"narHash": "sha256-1l6ZW+2+LDQhYgE4fo2KsM2Ms3lY3ZXv0n6uKka2yMk=",
"lastModified": 1750973805,
"narHash": "sha256-BZXgag7I0rnL/HMHAsBz3tQrfKAibpY2vovexl2lS+Y=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c5f345153397f62170c18ded1ae1f0875201d49a",
"rev": "080e8b48b0318b38143d5865de9334f46d51fce3",
"type": "github"
},
"original": {
@ -536,11 +536,11 @@
"nixpkgs-lib": "nixpkgs-lib_5"
},
"locked": {
"lastModified": 1749384866,
"narHash": "sha256-xWsaXDt1kV2NtvMuS+Rd62jqrWGgkFDeiRIa5yQRgGA=",
"lastModified": 1750594481,
"narHash": "sha256-0kAgoCQT8UdeRp21n/+YcHibJW+rlsnEqhzqG9KjaMo=",
"owner": "nix-community",
"repo": "lib-aggregate",
"rev": "ec6842bc742938f5f16608661cc4a1810fc177d3",
"rev": "7a1e10264592e0c2e088de07e6def27c66c74fb0",
"type": "github"
},
"original": {
@ -557,11 +557,11 @@
"scenefx": "scenefx"
},
"locked": {
"lastModified": 1750820757,
"narHash": "sha256-re+lgjvT6WkcjosQWbV/c0nW1Lz/ihenucMMapW9EHQ=",
"lastModified": 1750995192,
"narHash": "sha256-TjC5cjsDazAqKkapaMHxSwd6Xi6T8nBgmFySRFCmhaM=",
"owner": "DreamMaoMao",
"repo": "maomaowm",
"rev": "4fc468ec2922688afde6a64d1f75c87b269a966b",
"rev": "ccc03c525dd48e8444ff8bdc874a9839b83393f5",
"type": "github"
},
"original": {
@ -597,11 +597,11 @@
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1749896124,
"narHash": "sha256-+jwRKYksHw/XpLClxpSYQzEadsC0X3EHcIhtBD3p1AE=",
"lastModified": 1750610317,
"narHash": "sha256-tArf9ek4DoR+5lcDlshGS/CjMjX8vMNfpZ1Ys98UrZM=",
"owner": "viperML",
"repo": "nh",
"rev": "6000f87a413bb91b7a546b95f303766bf659ac30",
"rev": "e5dbcf9d48257f4a116bc4746e0c59c78e08e161",
"type": "github"
},
"original": {
@ -617,11 +617,11 @@
]
},
"locked": {
"lastModified": 1749796250,
"narHash": "sha256-oxvVAFUO9husnRk6XZcLFLjLWL9z0pW25Fk6kVKwt1c=",
"lastModified": 1750558251,
"narHash": "sha256-wmb+kcqG05jQA2RPq+KZhOeCxSEOAgumgp/remOsczs=",
"owner": "oxalica",
"repo": "nil",
"rev": "9e4cccb088440c20703d62db9de8d5ae06d4a449",
"rev": "4e5ac6ec65c775fbc6adba1c6022b29c7eccde0f",
"type": "github"
},
"original": {
@ -642,11 +642,11 @@
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
},
"locked": {
"lastModified": 1749890123,
"narHash": "sha256-pRkyWFytGAMaHlrOJIYYEur8NRDe0kTfMIhRdTeasRQ=",
"lastModified": 1750920099,
"narHash": "sha256-Nt906asgI25vQ+/FFHpZ2VeS8N3EMxRBlt9o7F2+Ib8=",
"owner": "sodiboo",
"repo": "niri-flake",
"rev": "8f39eb82488525728eda222b34e79b1ecf6d3f96",
"rev": "151cff5b067b51384cf88d5bd5a4ec74b5984c7c",
"type": "github"
},
"original": {
@ -658,16 +658,16 @@
"niri-stable": {
"flake": false,
"locked": {
"lastModified": 1740117926,
"narHash": "sha256-mTTHA0RAaQcdYe+9A3Jx77cmmyLFHmRoZdd8RpWa+m8=",
"lastModified": 1748151941,
"narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "b94a5db8790339cf9134873d8b490be69e02ac71",
"rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7",
"type": "github"
},
"original": {
"owner": "YaLTeR",
"ref": "v25.02",
"ref": "v25.05.1",
"repo": "niri",
"type": "github"
}
@ -675,11 +675,11 @@
"niri-unstable": {
"flake": false,
"locked": {
"lastModified": 1749797708,
"narHash": "sha256-P5x0U6AW5Zn20bARv4D83d8XlNaWK1st9QwBfSe+Vfg=",
"lastModified": 1750791124,
"narHash": "sha256-F5iVU/hjoSHSSe0gllxm0PcAaseEtGNanYK5Ha3k2Tg=",
"owner": "YalTeR",
"repo": "niri",
"rev": "f3f6e79eeca8924ff9cfea4b30006e5b782bc93e",
"rev": "37458d94b288945f6cfbd3c5c233f634d59f246c",
"type": "github"
},
"original": {
@ -696,11 +696,11 @@
]
},
"locked": {
"lastModified": 1749999717,
"narHash": "sha256-0e90USJ7piAzjU1u0TRrzCsvI5Sv6H/Kn4Mc1IdMDlo=",
"lastModified": 1750950123,
"narHash": "sha256-6szY9qylkKoK/bDkapBGOQubN0OWGFtwnwQwXImv704=",
"owner": "doronbehar",
"repo": "nix-matlab",
"rev": "ac8d65aeb173a6b9a2bb6f0a05c490a732259e2f",
"rev": "7d8d184a4a556a0f024c362455dae1bbe8082eb2",
"type": "gitlab"
},
"original": {
@ -807,11 +807,11 @@
},
"nixpkgs-lib_5": {
"locked": {
"lastModified": 1749345370,
"narHash": "sha256-w2J8aeSsMT6v6xAokr076vSCDHs5LRi2JkTUyNsEl4o=",
"lastModified": 1750555020,
"narHash": "sha256-/MjivcZIz8dyLOTFdJzS5Yazt2QCePQBh8uZooODaYw=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "2a3d74c76852805ec8eba6dd52350e85e75805ec",
"rev": "6fb7349157ee1bffd053b1fdd454aa74ff7b4aee",
"type": "github"
},
"original": {
@ -822,11 +822,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1749727998,
"narHash": "sha256-mHv/yeUbmL91/TvV95p+mBVahm9mdQMJoqaTVTALaFw=",
"lastModified": 1750838302,
"narHash": "sha256-aVkL3/yu50oQzi2YuKo0ceiCypVZpZXYd2P2p1FMJM4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd487183437963a59ba763c0cc4f27e3447dd6dd",
"rev": "7284e2decc982b81a296ab35aa46e804baaa1cfe",
"type": "github"
},
"original": {
@ -838,16 +838,16 @@
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1749668643,
"narHash": "sha256-gaWJEWGBW/g1u6o5IM4Un0vluv86cigLuBnjsKILffc=",
"lastModified": 1750838302,
"narHash": "sha256-aVkL3/yu50oQzi2YuKo0ceiCypVZpZXYd2P2p1FMJM4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1965fd20a39c8e441746bee66d550af78f0c0a7b",
"rev": "7284e2decc982b81a296ab35aa46e804baaa1cfe",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
@ -859,11 +859,11 @@
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1749956536,
"narHash": "sha256-OYF0A9FNzGDuYl3v+Q+dy6AcFTb9p57UA60swTeQVSM=",
"lastModified": 1750992987,
"narHash": "sha256-ueLme6/pxRd+j41pBipklDc9RXgYYwlZgQzc4Y0bxZA=",
"owner": "nix-community",
"repo": "nixpkgs-wayland",
"rev": "b919db08d6841351da7667ac6569506c15e50218",
"rev": "e64a845bd8e20a2978b281cc91750f26d4a1a263",
"type": "github"
},
"original": {
@ -906,11 +906,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1749794982,
"narHash": "sha256-Kh9K4taXbVuaLC0IL+9HcfvxsSUx8dPB5s5weJcc9pc=",
"lastModified": 1750776420,
"narHash": "sha256-/CG+w0o0oJ5itVklOoLbdn2dGB0wbZVOoDm4np6w09A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ee930f9755f58096ac6e8ca94a1887e0534e2d81",
"rev": "30a61f056ac492e3b7cdcb69c1e6abdcf00e39cf",
"type": "github"
},
"original": {
@ -922,11 +922,11 @@
},
"nixpkgs_5": {
"locked": {
"lastModified": 1749896453,
"narHash": "sha256-6+AmSZBogyr1zbVc2k4IBcmY/Yt39mC4+cfZi0n/AAA=",
"lastModified": 1751009538,
"narHash": "sha256-H5v0MWj6OuuX0ct9INuwJj5kLDA0jKozmUcd5XfR9a4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ba48a1f6ce571455cb631dee840c6cd401ea4adb",
"rev": "ce34f10e7180bdae28e8a3b0ab2f8c0ad4383506",
"type": "github"
},
"original": {
@ -938,11 +938,11 @@
},
"nixpkgs_6": {
"locked": {
"lastModified": 1749794982,
"narHash": "sha256-Kh9K4taXbVuaLC0IL+9HcfvxsSUx8dPB5s5weJcc9pc=",
"lastModified": 1750776420,
"narHash": "sha256-/CG+w0o0oJ5itVklOoLbdn2dGB0wbZVOoDm4np6w09A=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ee930f9755f58096ac6e8ca94a1887e0534e2d81",
"rev": "30a61f056ac492e3b7cdcb69c1e6abdcf00e39cf",
"type": "github"
},
"original": {
@ -954,11 +954,11 @@
},
"nixpkgs_7": {
"locked": {
"lastModified": 1749794982,
"narHash": "sha256-Kh9K4taXbVuaLC0IL+9HcfvxsSUx8dPB5s5weJcc9pc=",
"lastModified": 1750776420,
"narHash": "sha256-/CG+w0o0oJ5itVklOoLbdn2dGB0wbZVOoDm4np6w09A=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ee930f9755f58096ac6e8ca94a1887e0534e2d81",
"rev": "30a61f056ac492e3b7cdcb69c1e6abdcf00e39cf",
"type": "github"
},
"original": {
@ -994,11 +994,11 @@
"systems": "systems_4"
},
"locked": {
"lastModified": 1749924512,
"narHash": "sha256-IYv0yEFh86c+UnkcjrUAV0UeIE+9vMEeXDIF+YRlooc=",
"lastModified": 1750879244,
"narHash": "sha256-ClV6rZbPnd5wIcBYNiCdrbhtSzY6dwPRA4Z/z1cFcyo=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "e114d442b14f3a299307ca9b0f0eab20e821f419",
"rev": "f0764db7212003520341ac10ddcee50e9c458a6f",
"type": "github"
},
"original": {
@ -1014,11 +1014,11 @@
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1749983324,
"narHash": "sha256-UCht45QsAY3lARXXoaJ4KaoVMtYUQbXuvaTaD5aN6m8=",
"lastModified": 1751014584,
"narHash": "sha256-WxNcymgY5I+9RU9P3Uxa4L7vDN2/Ewc8B8mdDveJ5aE=",
"owner": "nix-community",
"repo": "NUR",
"rev": "783b27b3f6593f7c82d9dce4869b1b83814f378e",
"rev": "b2abfc4acc8e316c1e873d2f18439e3c4bffd74c",
"type": "github"
},
"original": {
@ -1122,11 +1122,11 @@
"scroll": {
"flake": false,
"locked": {
"lastModified": 1749900833,
"narHash": "sha256-aGqkx67LHp5jmXhT9OyRoC3OSSFuSyYk0cXjXMO79NM=",
"lastModified": 1750937876,
"narHash": "sha256-mwIypuDmsOjVTyFYCJbIWu8nZbUdbUeV2oXz/HXk/PI=",
"owner": "dawsers",
"repo": "scroll",
"rev": "8f9ba8ae41775fd04d1f7bcf964d54d39c403a24",
"rev": "2a9d4984a6826152c1c01237a25791f3faa37d99",
"type": "github"
},
"original": {
@ -1159,11 +1159,11 @@
"tinted-zed": "tinted-zed"
},
"locked": {
"lastModified": 1749905587,
"narHash": "sha256-sZpQM+InPCYwJQiTxs/PCCupwbYNaSCFi2Hvpl1/pOo=",
"lastModified": 1750950678,
"narHash": "sha256-ZNSjRDpaR/sAtrZNPO6RpGkHKdMb1oc1lkQN+6ZBvyU=",
"owner": "nix-community",
"repo": "stylix",
"rev": "77a8b26520f48305f3b1bacffaa8740dde8afa2a",
"rev": "c700d41bb8ee32baed490c8128c1077b2b27183b",
"type": "github"
},
"original": {
@ -1397,11 +1397,11 @@
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1749194973,
"narHash": "sha256-eEy8cuS0mZ2j/r/FE0/LYBSBcIs/MKOIVakwHVuqTfk=",
"lastModified": 1750931469,
"narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "a05be418a1af1198ca0f63facb13c985db4cb3c5",
"rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1",
"type": "github"
},
"original": {
@ -1413,16 +1413,16 @@
"xwayland-satellite-stable": {
"flake": false,
"locked": {
"lastModified": 1739246919,
"narHash": "sha256-/hBM43/Gd0/tW+egrhlWgOIISeJxEs2uAOIYVpfDKeU=",
"lastModified": 1748488455,
"narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "44590a416d4a3e8220e19e29e0b6efe64a80315d",
"rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"ref": "v0.5.1",
"ref": "v0.6",
"repo": "xwayland-satellite",
"type": "github"
}
@ -1430,11 +1430,11 @@
"xwayland-satellite-unstable": {
"flake": false,
"locked": {
"lastModified": 1749315541,
"narHash": "sha256-bEik1BfVOFnWvtOrcOHluos/edJ8f+G2y1QySbt/0Ak=",
"lastModified": 1750821680,
"narHash": "sha256-Bu5unTxnqok2RoU5P394Gh0vRaoyI/5xlOOJDF6akrc=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "da2ecb5be816de35e2efe23a408a1c49fe8b11ba",
"rev": "2e7c318ac2bbf699b6ab92ef91e661e16415dfac",
"type": "github"
},
"original": {

View file

@ -46,7 +46,7 @@
};
inputs = {
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
home-manager = {
url = "github:nix-community/home-manager/master";

View file

@ -3,11 +3,14 @@
homeManagerVersion,
config,
lib,
pkgs,
inputs,
...
}:
{
programs.qutebrowser = {
enable = true;
package = inputs.nixpkgs-stable.legacyPackages.${pkgs.system}.qutebrowser;
keyBindings = {
normal = {
";i" = "hint images download";

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ inputs, pkgs, ... }:
{
imports = [
./tofi.nix

View file

@ -2,41 +2,12 @@
{
programs.niri.settings.animations = {
window-open = {
spring = {
kind.spring = {
damping-ratio = 0.7;
stiffness = 300;
epsilon = 0.001;
};
};
window-close = {
easing = {
curve = "ease-out-quad";
duration-ms = 1000;
};
};
workspace-switch = {
spring = {
damping-ratio = 0.8;
stiffness = 600;
epsilon = 0.001;
};
};
horizontal-view-movement = {
spring = {
damping-ratio = 1.0;
stiffness = 600;
epsilon = 0.001;
};
};
window-movement = {
spring = {
damping-ratio = 1.0;
stiffness = 600;
epsilon = 0.001;
};
};
shaders = {
window-open =
custom-shader =
# glsl
''
// Example: fill the current geometry with a solid vertical gradient and
@ -97,7 +68,13 @@
return default_open(coords_geo, size_geo);
}
'';
window-close =
};
window-close = {
kind.easing = {
curve = "ease-out-quad";
duration-ms = 1000;
};
custom-shader =
let
inherit (config.lib.stylix) colors;
mkColor =
@ -325,136 +302,157 @@
return finalColor;
}
'';
window-resize =
# glsl
''
// Example: fill the current geometry with a solid vertical gradient.
vec4 solid_gradient(vec3 coords_curr_geo, vec3 size_curr_geo) {
vec3 coords = coords_curr_geo;
vec4 color = vec4(0.0);
};
window-resize.custom-shader =
# glsl
''
// Example: fill the current geometry with a solid vertical gradient.
vec4 solid_gradient(vec3 coords_curr_geo, vec3 size_curr_geo) {
vec3 coords = coords_curr_geo;
vec4 color = vec4(0.0);
// Paint only the area inside the current geometry.
if (0.0 <= coords.x && coords.x <= 1.0
&& 0.0 <= coords.y && coords.y <= 1.0)
{
vec4 from = vec4(1.0, 0.0, 0.0, 1.0);
vec4 to = vec4(0.0, 1.0, 0.0, 1.0);
color = mix(from, to, coords.y);
}
// Paint only the area inside the current geometry.
if (0.0 <= coords.x && coords.x <= 1.0
&& 0.0 <= coords.y && coords.y <= 1.0)
{
vec4 from = vec4(1.0, 0.0, 0.0, 1.0);
vec4 to = vec4(0.0, 1.0, 0.0, 1.0);
color = mix(from, to, coords.y);
}
return color;
}
return color;
}
// Example: crossfade between previous and next texture, stretched to the
// current geometry.
vec4 crossfade(vec3 coords_curr_geo, vec3 size_curr_geo) {
// Convert coordinates into the texture space for sampling.
vec3 coords_tex_prev = niri_geo_to_tex_prev * coords_curr_geo;
vec4 color_prev = texture2D(niri_tex_prev, coords_tex_prev.st);
// Example: crossfade between previous and next texture, stretched to the
// current geometry.
vec4 crossfade(vec3 coords_curr_geo, vec3 size_curr_geo) {
// Convert coordinates into the texture space for sampling.
vec3 coords_tex_prev = niri_geo_to_tex_prev * coords_curr_geo;
vec4 color_prev = texture2D(niri_tex_prev, coords_tex_prev.st);
// Convert coordinates into the texture space for sampling.
vec3 coords_tex_next = niri_geo_to_tex_next * coords_curr_geo;
vec4 color_next = texture2D(niri_tex_next, coords_tex_next.st);
// Convert coordinates into the texture space for sampling.
vec3 coords_tex_next = niri_geo_to_tex_next * coords_curr_geo;
vec4 color_next = texture2D(niri_tex_next, coords_tex_next.st);
vec4 color = mix(color_prev, color_next, niri_clamped_progress);
return color;
}
vec4 color = mix(color_prev, color_next, niri_clamped_progress);
return color;
}
// Example: next texture, stretched to the current geometry.
vec4 stretch_next(vec3 coords_curr_geo, vec3 size_curr_geo) {
vec3 coords_tex_next = niri_geo_to_tex_next * coords_curr_geo;
vec4 color = texture2D(niri_tex_next, coords_tex_next.st);
return color;
}
// Example: next texture, stretched to the current geometry.
vec4 stretch_next(vec3 coords_curr_geo, vec3 size_curr_geo) {
vec3 coords_tex_next = niri_geo_to_tex_next * coords_curr_geo;
vec4 color = texture2D(niri_tex_next, coords_tex_next.st);
return color;
}
// Example: next texture, stretched to the current geometry if smaller, and
// cropped if bigger.
vec4 stretch_or_crop_next(vec3 coords_curr_geo, vec3 size_curr_geo) {
vec3 coords_next_geo = niri_curr_geo_to_next_geo * coords_curr_geo;
// Example: next texture, stretched to the current geometry if smaller, and
// cropped if bigger.
vec4 stretch_or_crop_next(vec3 coords_curr_geo, vec3 size_curr_geo) {
vec3 coords_next_geo = niri_curr_geo_to_next_geo * coords_curr_geo;
vec3 coords_stretch = niri_geo_to_tex_next * coords_curr_geo;
vec3 coords_crop = niri_geo_to_tex_next * coords_next_geo;
vec3 coords_stretch = niri_geo_to_tex_next * coords_curr_geo;
vec3 coords_crop = niri_geo_to_tex_next * coords_next_geo;
// We can crop if the current window size is smaller than the next window
// size. One way to tell is by comparing to 1.0 the X and Y scaling
// coefficients in the current-to-next transformation matrix.
bool can_crop_by_x = niri_curr_geo_to_next_geo[0][0] <= 1.0;
bool can_crop_by_y = niri_curr_geo_to_next_geo[1][1] <= 1.0;
// We can crop if the current window size is smaller than the next window
// size. One way to tell is by comparing to 1.0 the X and Y scaling
// coefficients in the current-to-next transformation matrix.
bool can_crop_by_x = niri_curr_geo_to_next_geo[0][0] <= 1.0;
bool can_crop_by_y = niri_curr_geo_to_next_geo[1][1] <= 1.0;
vec3 coords = coords_stretch;
if (can_crop_by_x)
coords.x = coords_crop.x;
if (can_crop_by_y)
coords.y = coords_crop.y;
vec3 coords = coords_stretch;
if (can_crop_by_x)
coords.x = coords_crop.x;
if (can_crop_by_y)
coords.y = coords_crop.y;
vec4 color = texture2D(niri_tex_next, coords.st);
vec4 color = texture2D(niri_tex_next, coords.st);
// However, when we crop, we also want to crop out anything outside the
// current geometry. This is because the area of the shader is unspecified
// and usually bigger than the current geometry, so if we don't fill pixels
// outside with transparency, the texture will leak out.
//
// When stretching, this is not an issue because the area outside will
// correspond to client-side decoration shadows, which are already supposed
// to be outside.
if (can_crop_by_x && (coords_curr_geo.x < 0.0 || 1.0 < coords_curr_geo.x))
color = vec4(0.0);
if (can_crop_by_y && (coords_curr_geo.y < 0.0 || 1.0 < coords_curr_geo.y))
color = vec4(0.0);
// However, when we crop, we also want to crop out anything outside the
// current geometry. This is because the area of the shader is unspecified
// and usually bigger than the current geometry, so if we don't fill pixels
// outside with transparency, the texture will leak out.
//
// When stretching, this is not an issue because the area outside will
// correspond to client-side decoration shadows, which are already supposed
// to be outside.
if (can_crop_by_x && (coords_curr_geo.x < 0.0 || 1.0 < coords_curr_geo.x))
color = vec4(0.0);
if (can_crop_by_y && (coords_curr_geo.y < 0.0 || 1.0 < coords_curr_geo.y))
color = vec4(0.0);
return color;
}
return color;
}
// Example: cropped next texture if it's bigger than the current geometry, and
// crossfade between previous and next texture otherwise.
vec4 crossfade_or_crop_next(vec3 coords_curr_geo, vec3 size_curr_geo) {
vec3 coords_next_geo = niri_curr_geo_to_next_geo * coords_curr_geo;
vec3 coords_prev_geo = niri_curr_geo_to_prev_geo * coords_curr_geo;
// Example: cropped next texture if it's bigger than the current geometry, and
// crossfade between previous and next texture otherwise.
vec4 crossfade_or_crop_next(vec3 coords_curr_geo, vec3 size_curr_geo) {
vec3 coords_next_geo = niri_curr_geo_to_next_geo * coords_curr_geo;
vec3 coords_prev_geo = niri_curr_geo_to_prev_geo * coords_curr_geo;
vec3 coords_crop = niri_geo_to_tex_next * coords_next_geo;
vec3 coords_stretch = niri_geo_to_tex_next * coords_curr_geo;
vec3 coords_stretch_prev = niri_geo_to_tex_prev * coords_curr_geo;
vec3 coords_crop = niri_geo_to_tex_next * coords_next_geo;
vec3 coords_stretch = niri_geo_to_tex_next * coords_curr_geo;
vec3 coords_stretch_prev = niri_geo_to_tex_prev * coords_curr_geo;
// We can crop if the current window size is smaller than the next window
// size. One way to tell is by comparing to 1.0 the X and Y scaling
// coefficients in the current-to-next transformation matrix.
bool can_crop_by_x = niri_curr_geo_to_next_geo[0][0] <= 1.0;
bool can_crop_by_y = niri_curr_geo_to_next_geo[1][1] <= 1.0;
bool crop = can_crop_by_x && can_crop_by_y;
// We can crop if the current window size is smaller than the next window
// size. One way to tell is by comparing to 1.0 the X and Y scaling
// coefficients in the current-to-next transformation matrix.
bool can_crop_by_x = niri_curr_geo_to_next_geo[0][0] <= 1.0;
bool can_crop_by_y = niri_curr_geo_to_next_geo[1][1] <= 1.0;
bool crop = can_crop_by_x && can_crop_by_y;
vec4 color;
vec4 color;
if (crop) {
// However, when we crop, we also want to crop out anything outside the
// current geometry. This is because the area of the shader is unspecified
// and usually bigger than the current geometry, so if we don't fill pixels
// outside with transparency, the texture will leak out.
//
// When crossfading, this is not an issue because the area outside will
// correspond to client-side decoration shadows, which are already supposed
// to be outside.
if (coords_curr_geo.x < 0.0 || 1.0 < coords_curr_geo.x ||
coords_curr_geo.y < 0.0 || 1.0 < coords_curr_geo.y) {
color = vec4(0.0);
} else {
color = texture2D(niri_tex_next, coords_crop.st);
}
} else {
// If we can't crop, then crossfade.
color = texture2D(niri_tex_next, coords_stretch.st);
vec4 color_prev = texture2D(niri_tex_prev, coords_stretch_prev.st);
color = mix(color_prev, color, niri_clamped_progress);
}
if (crop) {
// However, when we crop, we also want to crop out anything outside the
// current geometry. This is because the area of the shader is unspecified
// and usually bigger than the current geometry, so if we don't fill pixels
// outside with transparency, the texture will leak out.
//
// When crossfading, this is not an issue because the area outside will
// correspond to client-side decoration shadows, which are already supposed
// to be outside.
if (coords_curr_geo.x < 0.0 || 1.0 < coords_curr_geo.x ||
coords_curr_geo.y < 0.0 || 1.0 < coords_curr_geo.y) {
color = vec4(0.0);
} else {
color = texture2D(niri_tex_next, coords_crop.st);
}
} else {
// If we can't crop, then crossfade.
color = texture2D(niri_tex_next, coords_stretch.st);
vec4 color_prev = texture2D(niri_tex_prev, coords_stretch_prev.st);
color = mix(color_prev, color, niri_clamped_progress);
}
return color;
}
return color;
}
// This is the function that you must define.
vec4 resize_color(vec3 coords_curr_geo, vec3 size_curr_geo) {
// You can pick one of the example functions or write your own.
return crossfade_or_crop_next(coords_curr_geo, size_curr_geo);
}
'';
// This is the function that you must define.
vec4 resize_color(vec3 coords_curr_geo, vec3 size_curr_geo) {
// You can pick one of the example functions or write your own.
return crossfade_or_crop_next(coords_curr_geo, size_curr_geo);
}
'';
workspace-switch = {
kind.spring = {
damping-ratio = 0.8;
stiffness = 600;
epsilon = 0.001;
};
};
horizontal-view-movement = {
kind.spring = {
damping-ratio = 1.0;
stiffness = 600;
epsilon = 0.001;
};
};
window-movement = {
kind.spring = {
damping-ratio = 1.0;
stiffness = 600;
epsilon = 0.001;
};
};
};
}

View file

@ -25,7 +25,8 @@ let
swhks &
doas swhkd -c ~/.config/niri/swhkd/niri.swhkdrc &
swww kill
swww-daemon &
swww-daemon --namespace "background" &
swww-daemon --namespace "backdrop" &
clash-meta -d ~/.config/clash &
wlsunset -s 00:00 -S 00:00 -t 5000 -T 5001 &
'';
@ -35,8 +36,7 @@ let
import subprocess
import json
wallpapers_path = "/home/${user}/Pictures/Wallpapers/generated/"
wallpapers_cache_path = "/home/${user}/.cache/swww/"
wallpapers_path = "/home/eden/Pictures/Wallpapers/generated/"
events_of_interest = [
"Workspace changed",
"Workspace focused",
@ -52,9 +52,17 @@ let
def get_current_wallpaper(monitor):
with open(os.path.join(wallpapers_cache_path, monitor)) as f:
wallpaper = str(f.read())
return wallpaper
output = (
subprocess.check_output(["swww", "query", "--namespace", "background"])
.decode()
.strip()
.split("\n")
)
output = [info.split(", ") for info in output]
for o in output:
if o[0].split(": ")[1] == monitor:
return o[2].split(": ")[2]
return None
def set_wallpaper(monitor, wallpaper):
@ -66,6 +74,8 @@ let
"fade",
"--transition-duration",
"0.3",
"--namespace",
"background",
"-o",
monitor,
wallpaper,
@ -76,13 +86,17 @@ let
def set_backdrop_wallpaper(monitor, wallpaper):
subprocess.Popen(
[
"swaybg",
"swww",
"img",
"--transition-type",
"fade",
"--transition-duration",
"0.3",
"--namespace",
"backdrop",
"-o",
monitor,
"-i",
wallpaper,
"-m",
"fill",
]
)

View file

@ -2,6 +2,7 @@
config,
pkgs,
user,
lib,
...
}:
{
@ -103,6 +104,10 @@
}
];
layer-rules = [
{
matches = [ { namespace = "swww-daemonbackdrop"; } ];
place-within-backdrop = true;
}
{
matches = [ { namespace = "launcher"; } ];
geometry-corner-radius = {
@ -139,6 +144,10 @@
name = "music";
};
};
xwayland-satellite = {
enable = true;
path = lib.getExe pkgs.xwayland-satellite;
};
overview = {
zoom = 0.36;
backdrop-color = base02;

View file

@ -3,20 +3,13 @@ with config.lib.stylix.colors.withHashtag;
let
extraConfig =
# kdl
''
layer-rule {
match namespace="wallpaper"
place-within-backdrop true
}
'';
'''';
finalNiriConfig =
builtins.replaceStrings
[
"output \"${config.lib.monitors.mainMonitorName}\" {"
# "layout {"
]
[
"output \"${config.lib.monitors.mainMonitorName}\" {\nfocus-at-startup"
# ''
# layout {
# blur {

View file

@ -6,6 +6,6 @@ if [ -z $wall ]; then
exit
fi
output=$(niri msg -j focused-output | jq -r .name)
swww img -o $output $wallpapers_dir/$wall --transition-type random --transition-duration 1
swww img -o $output $wallpapers_dir/$wall --transition-type random --transition-duration 1 --namespace background
blurwall=$(echo $wall | sed 's/\.jpg$/-blurred.jpg/')
swaybg -o $output -i $wallpapers_dir/$blurwall -m fill
swww img -o $output $wallpapers_dir/$blurwall --transition-type fade --namespace backdrop

View file

@ -43,6 +43,7 @@
nix-init
wl-color-picker
(config.lib.misc.addFlags "--wayland-text-input-version=3" "cherry-studio" cherry-studio)
gemini-cli
];
imports = [
./eye-candy.nix

View file

@ -13,6 +13,7 @@
y = 0;
};
rotation = 0;
focus-at-startup = true;
};
"HDMI-A-1" = {
scale = 1.6;

View file

@ -50,6 +50,11 @@ let
type = int;
description = "The rotation of the monitor";
};
focus-at-startup = mkOption {
type = bool;
default = false;
description = "Whether to focus this monitor at startup";
};
};
};
in

View file

@ -28,6 +28,7 @@
sway = prev.sway.overrideAttrs (oldAttrs: {
passthru.providedSessions = [ "scroll" ];
});
inherit (inputs.nixpkgs-wayland.packages.${final.system}) swww;
};
inherit (inputs.niri.overlays) niri;