mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-08-07 22:20:33 +02:00
added more background related stuff
This commit is contained in:
parent
cc74b15953
commit
ba5f71b18d
6 changed files with 28 additions and 0 deletions
28
home-manager/dotfiles/niri/background.sh
Executable file
28
home-manager/dotfiles/niri/background.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
# Changes the wallpaper to a randomly chosen image in a given directory
|
||||
# at a set interval.
|
||||
|
||||
DEFAULT_INTERVAL=300 # In seconds
|
||||
|
||||
if [ $# -lt 1 ] || [ ! -d "$1" ]; then
|
||||
printf "Usage:\n\t\e[1m%s\e[0m \e[4mDIRECTORY\e[0m [\e[4mINTERVAL\e[0m]\n" "$0"
|
||||
printf "\tChanges the wallpaper to a randomly chosen image in DIRECTORY every\n\tINTERVAL seconds (or every %d seconds if unspecified)." "$DEFAULT_INTERVAL"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# See swww-img(1)
|
||||
RESIZE_TYPE="fit"
|
||||
export SWWW_TRANSITION_FPS="${SWWW_TRANSITION_FPS:-60}"
|
||||
export SWWW_TRANSITION_STEP="${SWWW_TRANSITION_STEP:-2}"
|
||||
|
||||
while true; do
|
||||
find "$1" -type f |
|
||||
while read -r img; do
|
||||
echo "$(</dev/urandom tr -dc a-zA-Z0-9 | head -c 8):$img"
|
||||
done |
|
||||
sort -n | cut -d':' -f2- |
|
||||
while read -r img; do
|
||||
swww img --resize="$RESIZE_TYPE" "$img"
|
||||
sleep "${2:-$DEFAULT_INTERVAL}"
|
||||
done
|
||||
done
|
Binary file not shown.
Before Width: | Height: | Size: 219 KiB |
BIN
home-manager/dotfiles/niri/wallpapers/wallhaven-dpvjoj.jpg
Normal file
BIN
home-manager/dotfiles/niri/wallpapers/wallhaven-dpvjoj.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 469 KiB |
BIN
home-manager/dotfiles/niri/wallpapers/wallhaven-p2v1vp.jpg
Normal file
BIN
home-manager/dotfiles/niri/wallpapers/wallhaven-p2v1vp.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 257 KiB |
BIN
home-manager/dotfiles/niri/wallpapers/wallhaven-rrderq.jpg
Normal file
BIN
home-manager/dotfiles/niri/wallpapers/wallhaven-rrderq.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 MiB |
BIN
home-manager/dotfiles/niri/wallpapers/wallhaven-zpgk8v.png
Normal file
BIN
home-manager/dotfiles/niri/wallpapers/wallhaven-zpgk8v.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.7 MiB |
Loading…
Add table
Add a link
Reference in a new issue