Swaylock: Difference between revisions

34j (talk | contribs)
Phobos (talk | contribs)
m Updated Swaylock page
Line 1: Line 1:
swaylock is a screen locking utility for Wayland compositors.
[https://github.com/swaywm/swaylock Swaylock] is a screen locking utility for Wayland compositors.


== Installation ==
== Installation ==


Install via [[Home Manager]]:
=== Standalone ===
{{File|3=environment.systemPackages = with pkgs; [
  swaylock
];|name=/etc/nixos/configuration.nix|lang=nix}}


=== Through Sway ===
{{File|3=programs.sway.extraPackages = with pkgs; [swaylock];|name=/etc/nixos/configuration.nix|lang=nix}}
=== Home Manager ===
{{file|~/.config/home-manager/home.nix|nix|3=
{{file|~/.config/home-manager/home.nix|nix|3=
programs.swaylock.enable = true;
programs.swaylock.enable = true;
}}
}}


The following settings may be required.
{{Warning|1=If you don't use the Sway module (<code>programs.sway.enable</code>) you need to set <code>security.pam.services.swaylock = {};</code> manually.}}
 
{{file|/etc/nixos/configuration.nix|nix|3=
security.pam.services.swaylock = {};
}}


== Configuration ==
== Configuration ==


swaylock can be configured using [[Home Manager]]:
Swaylock may be configured using [[Home Manager]], options may be found under the [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.swaylock.enable Home Manager Appendix - programs.sway.enable].
 
{{file|~/.config/home-manager/home.nix|nix|3=
programs.swaylock.settings = { color = "808080"; };
}}


Alternatively, you may write configuration without using Nix language:
{{File|3=programs.swaylock = {
  enable = true;
  settings = {
    color = "808080";
    font-size = 24;
    indicator-idle-visible = false;
    indicator-radius = 100;
    line-color = "ffffff";
    show-failed-attempts = true;
  };
};|name=/etc/nixos/home.nix|lang=nix}}


{{file|~/.config/home-manager/home.nix|nix|3=
If you would like to use a config file instead you may instead specify a config file.
xdg.configFile."swaylock/config".source = ./swaylock-theme;
}}


You may find "Swaylock theme"s shared on the web.
{{File|3=xdg.configFile."swaylock/config".source = ./swaylock-theme;|name=/etc/nixos/home.nix|lang=nix}}


=== Adding background ===
=== Adding background ===