home/swaylock: use upstream swaylock

This commit is contained in:
Guanran Wang 2024-07-21 14:49:16 +08:00
parent ec117d1dac
commit fdec3cf0a8
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF
4 changed files with 40 additions and 47 deletions

View file

@ -1,20 +1,10 @@
{
config,
pkgs,
lib,
config,
inputs,
pkgs,
...
}: let
# https://www.pixiv.net/en/artworks/49983419
image = pkgs.fetchurl {
url = "https://i.pximg.net/img-original/img/2015/04/23/12/43/35/49983419_p0.jpg";
hash = "sha256-JZ5VmsjVjZfHXpx3JxzAyYzZppZmgH38AiAA+B0TDiw=";
curlOptsList = ["-e" "https://www.pixiv.net/"];
};
# Crop 100px on top and bottom
background = pkgs.runCommandLocal "49983419_p0.jpg" {} ''
${lib.getExe pkgs.imagemagick} convert ${image} -crop 3500x1600+0+100 $out
'';
in {
}: {
imports = [
../i3status-rust
../kanshi
@ -56,7 +46,7 @@ in {
];
### Visuals
output."*".bg = "${background} fill";
output."*".bg = "${inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.background} fill";
bars = [
{
statusCommand = "${lib.getExe pkgs.i3status-rust} $HOME/.config/i3status-rust/config-default.toml";

View file

@ -1,39 +1,16 @@
{pkgs, ...}: {
{
inputs,
pkgs,
...
}: {
programs.swaylock = {
enable = true;
package = pkgs.swaylock-effects;
settings = {
daemonize = true;
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;
show-failed-attempts = true;
show-keyboard-layout = true;
image = toString inputs.self.legacyPackages.${pkgs.stdenv.hostPlatform.system}.background.dark;
scaling = "fill";
};
};
}

24
pkgs/background.nix Normal file
View file

@ -0,0 +1,24 @@
{
fetchurl,
imagemagick,
runCommandLocal,
}:
runCommandLocal "49983419_p0.jpg" {
nativeBuildInputs = [imagemagick];
# https://www.pixiv.net/en/artworks/49983419
image = fetchurl {
url = "https://i.pximg.net/img-original/img/2015/04/23/12/43/35/49983419_p0.jpg";
hash = "sha256-JZ5VmsjVjZfHXpx3JxzAyYzZppZmgH38AiAA+B0TDiw=";
curlOptsList = ["-e" "https://www.pixiv.net/"];
};
outputs = ["out" "dark"];
} ''
magick $image -crop 3500x1600+0+100 $out
magick $image \
-crop 3500x1600+0+100 \
-blur 8x8 \
-brightness-contrast -10,0 \
$dark
''

View file

@ -6,6 +6,8 @@ in {
# https://github.com/NixOS/nixpkgs/pull/308720
pixivfe = callPackage ./pixivfe.nix {};
background = callPackage ./background.nix {};
scripts = lib.makeScope pkgs.newScope (self: let
inherit (self) callPackage;
in {