Skip to content

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

My dotfiles include seamless support for both ๐ŸŒŒ Nord and ๐ŸŒฒ Everforest wallpapers, dynamically managed through Nix flakes and tightly coupled with the current color scheme. Beautiful wallpapers, automatically in sync with your system theme. ๐ŸŒˆ๐Ÿš€


๐Ÿ“ฆ Flake Inputs ๐ŸงŠ๐ŸŒฟ

Both wallpaper collections are added as inputs in flake.nix:

{
  inputs = {
    nord-wallpapers = {
      url = "github:Gurjaka/Nord-Wallpapers";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    everforest-wallpapers = {
      url = "github:Gurjaka/Everforest-Wallpapers";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
}

๐Ÿก Home Manager Integration ๐Ÿ”—๐Ÿ“‚

In home-manager/modules/theme/wallpapers.nix, the contents of each repo are symlinked into ~/.config/wallpapers/:

{ inputs, pkgs, ... }:

{
  home.file = {
    ".config/wallpapers/nord/" = {
      source = inputs.nord-wallpapers.packages."${pkgs.system}".default;
      recursive = true;
    };
    ".config/wallpapers/everforest/" = {
      source = inputs.everforest-wallpapers.packages."${pkgs.system}".default;
      recursive = true;
    };
  };
}

๐Ÿ“ This setup ensures all wallpapers are in one tidy location based on theme. ๐Ÿงผโœจ


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

A custom script called wallrandom randomly picks a wallpaper based on the current theme, then applies it using swww with a beautiful animated transition. ๐ŸŒ 

Defined in wallrandom.nix:

{ pkgs }:

pkgs.writeShellScriptBin "wallrandom" ''
  set -e

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

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

  DIR=$HOME/.config/wallpapers/$current
  PICS=($(ls ''${DIR}))
  RANDOMPICS=''${PICS[ $RANDOM % ''${#PICS[@]} ]}

  swww query || swww-daemon

  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 from the flake
  • ๐ŸŽฒ 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. ๐Ÿง™


These collections are handcrafted and curated with aesthetics and compatibility in mind. ๐ŸŽจ๐Ÿง˜โ€โ™‚๏ธ