๐จ 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
colorschemeas defined inflake.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
swwwtransition.
๐งช 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. ๐ง