๐ŸŽจ Wallpaper Integration โœจ๐Ÿ–ผ๏ธ

This project utilizes the Juna theming system to seamlessly manage wallpaper collections. Juna automatically integrates various wallpaper sets, ensuring they are dynamically coupled with your active color scheme. This provides a cohesive visual experience where your wallpapers always complement your chosen system theme. ๐ŸŒˆ๐Ÿš€


๐Ÿ” Dynamic Wallpaper Switching (wallrandom) ๐ŸŽฒ๐Ÿ–ผ๏ธ

The wallrandom script intelligently selects and applies wallpapers based on your current Juna-managed theme. It leverages swww for smooth, animated transitions when changing wallpapers.

The script, located at home-manager/modules/cli/scripts/wallrandom.nix, works as follows:

{ pkgs }:

pkgs.writeShellScriptBin "wallrandom" ''
  set -e

  FLAKE=$HOME/Dotfiles/flake.nix
  FLAKE_DIR=$HOME/Dotfiles

  # Detect current theme
  current=$(grep 'colorscheme = "' "$FLAKE" | sed -E 's/.*"([^"]+)".*/\1/')

  DIR=$HOME/.config/wallpapers/$current
  PICS=($(ls ''${DIR}))

  RANDOMPICS=''${PICS[ $RANDOM % ''${#PICS[@]} ]}

  ${pkgs.swww}/bin/swww query || swww-daemon

  #change-wallpaper using swww
  ${pkgs.swww}/bin/swww img ''${DIR}/''${RANDOMPICS} --transition-fps 165 --transition-type grow  --transition-pos 0.2,0.2 --transition-duration 1
''

๐Ÿ” This script:

  • ๐Ÿ”Ž Detects your current colorscheme as defined in flake.nix.
  • ๐Ÿ“‚ Accesses wallpapers automatically set up by Juna in ~/.config/wallpapers/<current-theme>.
  • ๐ŸŽฒ Picks a random wallpaper from the theme-matched folder.
  • ๐ŸŒ„ Applies it with a smooth swww transition.

๐Ÿงช Usage ๐Ÿ’ปโšก

Once wallrandom is in your $PATH, just run:

wallrandom

๐Ÿ’ก Pro Tip: Bind this to a keyboard shortcut in your WM for instant wallpaper shuffle magic. You can also run this script after changing themes to apply a new wallpaper matching the fresh look. ๐Ÿง™