diff --git a/users/guanranwang/home-manager/nixos/wm/default.nix b/users/guanranwang/home-manager/nixos/wm/default.nix index 0b64904..1e9b1ec 100644 --- a/users/guanranwang/home-manager/nixos/wm/default.nix +++ b/users/guanranwang/home-manager/nixos/wm/default.nix @@ -4,6 +4,7 @@ ./rofi.nix ./sway.nix ./swayidle.nix + ./swaylock.nix ./udiskie.nix ./waybar.nix ]; diff --git a/users/guanranwang/home-manager/nixos/wm/sway.nix b/users/guanranwang/home-manager/nixos/wm/sway.nix index fca01da..6049cd7 100644 --- a/users/guanranwang/home-manager/nixos/wm/sway.nix +++ b/users/guanranwang/home-manager/nixos/wm/sway.nix @@ -22,7 +22,6 @@ pavucontrol wl-clipboard cliphist - swaylock-effects grim slurp swappy diff --git a/users/guanranwang/home-manager/nixos/wm/swayidle.nix b/users/guanranwang/home-manager/nixos/wm/swayidle.nix index cee75dd..8062c9d 100644 --- a/users/guanranwang/home-manager/nixos/wm/swayidle.nix +++ b/users/guanranwang/home-manager/nixos/wm/swayidle.nix @@ -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 ]; }; diff --git a/users/guanranwang/home-manager/nixos/wm/swaylock.nix b/users/guanranwang/home-manager/nixos/wm/swaylock.nix new file mode 100644 index 0000000..0be312b --- /dev/null +++ b/users/guanranwang/home-manager/nixos/wm/swaylock.nix @@ -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; + }; + }; +} diff --git a/users/guanranwang/home-manager/resources/dotfiles/bin/wrapped-swaylock-effects b/users/guanranwang/home-manager/resources/dotfiles/bin/wrapped-swaylock-effects deleted file mode 100755 index 1480043..0000000 --- a/users/guanranwang/home-manager/resources/dotfiles/bin/wrapped-swaylock-effects +++ /dev/null @@ -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