This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools: init lockscreen

+21
+21
tools/lockscreen/flake-module.nix
··· 1 + { 2 + perSystem = 3 + { pkgs, lib, ... }: 4 + { 5 + packages.lockscreen = pkgs.writeShellApplication { 6 + name = "lockscreen"; 7 + runtimeInputs = [ 8 + pkgs.ffmpeg 9 + pkgs.coreutils 10 + pkgs.swaylock-plugin 11 + pkgs.mpvpaper 12 + ]; 13 + text = '' 14 + VIDEO=$(shuf -n1 -e "$HOME"/lockscreens/*.mp4) 15 + DURATION=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$VIDEO" 2>/dev/null | cut -d. -f1) 16 + START=$((RANDOM % ''${DURATION:-300})) 17 + exec swaylock-plugin --command "mpvpaper -o \"no-audio loop start=$START\" '*' \"$VIDEO\"" "$@" 18 + ''; 19 + }; 20 + }; 21 + }