home,swaylock: wrapper -> home-manager options

This commit is contained in:
Guanran Wang 2023-11-05 21:35:28 +08:00
parent d683d4bb53
commit eae9f55a99
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
5 changed files with 46 additions and 9 deletions

View file

@ -4,6 +4,7 @@
./rofi.nix
./sway.nix
./swayidle.nix
./swaylock.nix
./udiskie.nix
./waybar.nix
];

View file

@ -22,7 +22,6 @@
pavucontrol
wl-clipboard
cliphist
swaylock-effects
grim
slurp
swappy

View file

@ -1,8 +1,10 @@
{pkgs, ...}: {
imports = [
./swaylock.nix
];
services = {
swayidle = let
lockCommand = "${pkgs.swaylock-effects}/bin/swaylock --screenshots --clock --indicator --line-color cdd6f4ff --text-color cdd6f4ff --inside-color 1e1e2eff --ring-color 313244ff --line-ver-color cdd6f4ff --text-ver-color cdd6f4ff --inside-ver-color 1e1e2eff --ring-ver-color 313244ff --line-clear-color cdd6f4ff --text-clear-color cdd6f4ff --inside-clear-color 1e1e2eff --ring-clear-color 313244ff --line-clear-color cdd6f4ff --text-wrong-color 313244ff --inside-wrong-color f38ba8ff --ring-wrong-color 313244ff --key-hl-color cba6f7ff --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2";
in {
swayidle = {
enable = true;
timeouts = [
{
@ -18,11 +20,11 @@
events = [
{
event = "lock";
command = lockCommand;
command = "swaylock";
} # loginctl lock-session
{
event = "before-sleep";
command = lockCommand;
command = "swaylock";
} # systemctl syspend
];
};

View file

@ -0,0 +1,38 @@
{pkgs, ...}: {
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
screenshots = true;
clock = true;
indicator = true;
# i forgot which colorscheme is this
# TODO: switch to tokyonight
line-color = "cdd6f4ff";
text-color = "cdd6f4ff";
inside-color = "1e1e2eff";
ring-color = "313244ff";
line-ver-color = "cdd6f4ff";
text-ver-color = "cdd6f4ff";
inside-ver-color = "1e1e2eff";
ring-ver-color = "313244ff";
line-clear-color = "cdd6f4ff";
text-clear-color = "cdd6f4ff";
inside-clear-color = "1e1e2eff";
ring-clear-color = "313244ff";
line-wrong-color = "cdd6f4ff";
text-wrong-color = "313244ff";
inside-wrong-color = "f38ba8ff";
ring-wrong-color = "313244ff";
key-hl-color = "cba6f7ff";
effect-blur = "7x5";
effect-vignette = "0.5:0.5";
fade-in = 0.2;
};
};
}

View file

@ -1,3 +0,0 @@
#!/bin/sh
pidof swaylock || swaylock --screenshots --clock --indicator --line-color cdd6f4ff --text-color cdd6f4ff --inside-color 1e1e2eff --ring-color 313244ff --line-ver-color cdd6f4ff --text-ver-color cdd6f4ff --inside-ver-color 1e1e2eff --ring-ver-color 313244ff --line-clear-color cdd6f4ff --text-clear-color cdd6f4ff --inside-clear-color 1e1e2eff --ring-clear-color 313244ff --line-clear-color cdd6f4ff --text-wrong-color 313244ff --inside-wrong-color f38ba8ff --ring-wrong-color 313244ff --key-hl-color cba6f7ff --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2