This repository has no description
0

Configure Feed

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

superconfig / tools / wallpaper / flake-module.nix
1.3 kB 33 lines
1{ 2 perSystem = 3 { pkgs, ... }: 4 { 5 packages.wallpaper = 6 (pkgs.writeShellApplication { 7 name = "wallpaper"; 8 runtimeInputs = [ 9 pkgs.coreutils 10 pkgs.findutils 11 pkgs.mpvpaper 12 ]; 13 text = '' 14 # Pick a random wallpaper (video or image) from ~/wallpaper and 15 # render it on every output via mpvpaper. Long-running: this 16 # process *is* the wallpaper. `-p` auto-pauses playback while the 17 # wallpaper is fully hidden to save power. 18 FILE=$(find "$HOME/wallpaper" -type f \( \ 19 -iname '*.mp4' -o -iname '*.webm' -o -iname '*.mkv' -o -iname '*.mov' -o \ 20 -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.gif' -o -iname '*.webp' \ 21 \) 2>/dev/null | shuf -n 1) 22 if [ -z "$FILE" ]; then 23 echo "wallpaper: no wallpapers found in ~/wallpaper" >&2 24 exit 0 25 fi 26 exec mpvpaper -p \ 27 -o "no-audio loop-file=inf image-display-duration=inf hwdec=auto-safe msg-level=all=no" \ 28 '*' "$FILE" 29 ''; 30 }).overrideAttrs 31 { passthru.usage = builtins.readFile ./usage.kdl; }; 32 }; 33}