From 3b4f9240fb6393c693b2a8ad99f20309cc48c26d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 12 Aug 2024 14:31:26 +0200 Subject: ... --- accounts/gkleen@sif/default.nix | 56 +++++++++++++++++++++++++++++++++++++--- accounts/gkleen@sif/hyprland.nix | 1 - accounts/gkleen@sif/systemd.nix | 5 ++++ 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index a0ffc581..7ff0afc6 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -94,6 +94,53 @@ let export __VK_LAYER_NV_optimus=NVIDIA_only exec -a "$1" "$@" ''; + + lockCommand = pkgs.writeShellScript "gtklock" '' + set -x + + export PATH="${lib.makeBinPath [cfg.programs.wpaperd.package pkgs.jq pkgs.coreutils pkgs.gtklock pkgs.imagemagick pkgs.findutils]}:$PATH" + + tmpDir=$(mktemp -d --tmpdir="$RUNTIME_DIRECTORY" "gtklock.$(date -uIs).XXXXXXXX") + + args=() + + cp --no-preserve=mode ${pkgs.writeText "gtklock.css" '' + #window-box { + padding: 64px; + /* border: 1px solid black; */ + border-radius: 4px; + box-shadow: rgba(0, 0, 0, 0.8) 0px 4px 12px; + /* background-color: white; */ + background-color: rgba(0, 0, 0, 0.5); + } + ''} "$tmpDir"/style.css + + monitors=() + while IFS= read -r entry; do + path=$(jq -r ".path" <<<"$entry") + [[ -z "$path" || ! -f "$path" ]] && continue + display=$(jq -r ".display" <<<"$entry") + monitors+=("$display") + # ln -s "$path" "$tmpDir"/"$display"."''${path##*.}" + magick "$path" -filter Gaussian -resize 6.25% -define filter:sigma=2.5 -resize 1600% "$tmpDir"/"$display"."''${path##*.}" & + done < <(wpaperctl all-wallpapers -j | jq -c ".[]") + wait + for monitor in "''${monitors[@]}"; do + path=$(find "$tmpDir" -name "$monitor"'.*') + cat >>"$tmpDir"/style.css <