Swaylock: Difference between revisions

34j (talk | contribs)
mNo edit summary
34j (talk | contribs)
Configuration: Add Adding Background
Line 30: Line 30:


You may find "Swaylock theme"s shared on the web.
You may find "Swaylock theme"s shared on the web.
=== Adding background ===
You can add background declaratively using {{Nixpkgs Manual|name=fetchurl|anchor=#sec-pkgs-fetchers-fetchurl}} similar to [[Wallpapers for Wayland]]. In this example, a wallpaper in [https://github.com/NixOS/nixos-artwork/tree/master/wallpapers nixos-artwork] is used.
{{file|~/.config/home-manager/home.nix|nix|3=
xdg.configFile."swaylock/config".text =
  let
    src = pkgs.fetchurl {
      url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/8957e93c95867faafec7f9988cedddd6837859fa/wallpapers/nix-wallpaper-binary-black.png";
      sha256 = "0v3111a1ihsh4ajijbjh6y7a8p5cb5g3rdxqjbzx37pn1k9s254s";
    };
  in
  ''
    image=${src}
  ''
  + builtins.readFile ./swaylock;
}}


== Forks ==
== Forks ==