Swaylock: Difference between revisions
Add Configuration |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 20: | Line 20: | ||
{{file|~/.config/home-manager/home.nix|nix|3= | {{file|~/.config/home-manager/home.nix|nix|3= | ||
programs.swaylock.settings = {}; | programs.swaylock.settings = { color = "808080"; }; | ||
}} | }} | ||
Line 26: | Line 26: | ||
{{file|~/.config/home-manager/home.nix|nix|3= | {{file|~/.config/home-manager/home.nix|nix|3= | ||
xdg.configFile."swaylock/config" = ./swaylock | xdg.configFile."swaylock/config".source = ./swaylock-theme; | ||
}} | }} | ||
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 set to {{ic|image}} attribute and the remaining configuration from {{ic|./swaylock}} are merged. | |||
{{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 == |