summaryrefslogtreecommitdiff
path: root/home-manager/features/gui/desktops/niri/parts/swww.nix
blob: ce4002cc80ea4b5207feef9094f4dbdc323abec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{ config, pkgs, lib, ... }: let
  cfg = config.features.gui.desktops.niri.parts.swww;
  aes = config.aesthetics;
in {
  options.features.gui.desktops.niri.parts.swww.enable = lib.mkEnableOption "swww";
  config = lib.mkIf cfg.enable {
    home.packages = [
      pkgs.swww
      (pkgs.writers.writeNuBin "swww-init" ''
        niri msg action spawn -- swww-daemon

        if not ("~/.cache/swww" | path expand | path exists) {
          swww img ${aes.wallpaper}
        }
      '')
    ];
  };
}