forked from
lass.pds.lassul.us/superconfig
This repository has no description
732 B
22 lines
1{
2 perSystem =
3 { pkgs, ... }:
4 {
5 packages.lockscreen = (pkgs.writeShellApplication {
6 name = "lockscreen";
7 runtimeInputs = [
8 pkgs.ffmpeg
9 pkgs.coreutils
10 pkgs.procps
11 pkgs.swaylock-plugin
12 pkgs.mpvpaper
13 ];
14 text = ''
15 VIDEO=$(shuf -n1 -e "$HOME"/lockscreens/*.mp4)
16 DURATION=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$VIDEO" 2>/dev/null | cut -d. -f1)
17 START=$((RANDOM % ''${DURATION:-300}))
18 exec swaylock-plugin --command "mpvpaper -o \"no-audio loop start=$START\" '*' \"$VIDEO\"" "$@"
19 '';
20 }).overrideAttrs { passthru.usage = builtins.readFile ./usage.kdl; };
21 };
22}