batman
86
.script/swww.sh
Executable file
|
@ -0,0 +1,86 @@
|
|||
#!/bin/bash --norc
|
||||
# ╭───────────────╮
|
||||
# │ SWWW-settings │
|
||||
# ╰───────────────╯
|
||||
export SWWW_TRANSITION_FPS=60
|
||||
export SWWW_TRANSITION_STEP=60
|
||||
export SWWW_TRANSITION=center
|
||||
|
||||
# ╭───────────────────────────────────────────────────────────────────────────╮
|
||||
# │ Set default excluded directories if SWWW_EXCLUDED_DIRS is not already set │
|
||||
# │ Dirs to exclude: Anime, Colorful, Gaming, Gifs, Gruvbox, Logos, Muted, │
|
||||
# │ Nordic, Windoof │
|
||||
# ╰───────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
: "${SWWW_EXCLUDED_DIRS:=Anime,Colorful,Gaming,Gifs,Logos,Muted,Nordic,Windoof}"
|
||||
|
||||
_swww() {
|
||||
if [ -z "$1" ]; then
|
||||
# ─< random wallpaper selection >─────────────────────────────────────────────────────────
|
||||
local wall_dir="$HOME/.wallpapers"
|
||||
|
||||
# ─< Create an array of directories to exclude >──────────────────────────────────────────
|
||||
IFS=',' read -ra EXCLUDED_DIRS <<<"$SWWW_EXCLUDED_DIRS"
|
||||
|
||||
# ─< Build the find command with exclusions >─────────────────────────────────────────────
|
||||
local find_cmd="find \"$wall_dir\" -type f \( -iname \"*.png\" -o -iname \"*.jpg\" -o -iname \"*.gif\" -o -iname \"*.PNG\" -o -iname \"*.JPG\" -o -iname \"*.GIF\" \) -not -path \"*/\.git/*\""
|
||||
|
||||
for dir in "${EXCLUDED_DIRS[@]}"; do
|
||||
find_cmd+=" -not -path \"$wall_dir/$dir/*\""
|
||||
done
|
||||
|
||||
# ─< Select a random picture >────────────────────────────────────────────────────────────
|
||||
local pic=$(eval $find_cmd | shuf -n 1)
|
||||
|
||||
# ─< checking for swww >──────────────────────────────────────────────────────────────────
|
||||
if command -v swww >/dev/null 2>&1; then
|
||||
# ─< Check if swww daemon is running, start if not >─────────────────────────────────────
|
||||
if ! pgrep -x "swww" >/dev/null; then
|
||||
notify-send "SWWW" "swww not running - starting it now"
|
||||
swww-daemon
|
||||
sleep 1 # Give the daemon a second to start
|
||||
if pgrep -x "swww" >/dev/null; then
|
||||
notify-send "SWWW" "started successfully"
|
||||
else
|
||||
notify-send "ERROR" "seems like swww didn't come up as exspected"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ─< checking the wall_dir variable >─────────────────────────────────────────────────────
|
||||
if [[ -d "$wall_dir" ]]; then
|
||||
# ─< executing swww with the random $pic >────────────────────────────────────────────────
|
||||
swww img "$pic"
|
||||
# --transition-fps "$SWWW_TRANSITION_FPS" --transition-step "$SWWW_TRANSITION_STEP" --transition-type "$SWWW_TRANSITION"
|
||||
notify-send " " "Changed wallpaper to $pic"
|
||||
notify-send " " "Not sourcing from: $SWWW_EXCLUDED_DIRS"
|
||||
else
|
||||
notify-send "ERROR" "$wall_dir path not found"
|
||||
fi
|
||||
else
|
||||
notify-send "ERROR" "swww was not found on the system"
|
||||
fi
|
||||
else
|
||||
if command -v swww >/dev/null 2>&1; then
|
||||
# ─< Check if swww daemon is running, start if not >─────────────────────────────────────
|
||||
if ! pgrep -x "swww" >/dev/null; then
|
||||
notify-send "SWWW" "swww not running - starting it now"
|
||||
swww-daemon
|
||||
sleep 1 # Give the daemon a second to start
|
||||
if pgrep -x "swww" >/dev/null; then
|
||||
notify-send "SWWW" "started successfully"
|
||||
else
|
||||
notify-send "ERROR" "seems like swww didn't come up as exspected"
|
||||
fi
|
||||
fi
|
||||
# ─< executing swww with the random $pic >────────────────────────────────────────────────
|
||||
swww img "$1"
|
||||
# --transition-fps "$SWWW_TRANSITION_FPS" --transition-step "$SWWW_TRANSITION_STEP" --transition-type "$SWWW_TRANSITION"
|
||||
notify-send " " "Changed wallpaper to $1"
|
||||
else
|
||||
notify-send "ERROR" "$1 not found"
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
_swww "$@"
|
BIN
Anime/Anime-Girl-2.png
Normal file
After Width: | Height: | Size: 9.2 MiB |
BIN
Anime/Anime-girl.png
Normal file
After Width: | Height: | Size: 4.5 MiB |
BIN
Anime/anime-girl-abyss.png
Normal file
After Width: | Height: | Size: 2.8 MiB |
BIN
Anime/arcade_decay_red.png
Normal file
After Width: | Height: | Size: 8.4 MiB |
BIN
Anime/arch-chan_to.png
Normal file
After Width: | Height: | Size: 5.6 MiB |
BIN
Anime/sad-depressing-anime-girl.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
Colorful/Forest-Dark.png
Normal file
After Width: | Height: | Size: 2.8 MiB |
BIN
Colorful/Forest-Light.png
Normal file
After Width: | Height: | Size: 8.2 MiB |
BIN
Colorful/Lofi-Computer.png
Normal file
After Width: | Height: | Size: 3.6 MiB |
BIN
Colorful/Lofi-Urban-Nightscape.png
Normal file
After Width: | Height: | Size: 13 MiB |
BIN
Colorful/emerald-beach.jpg
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
Colorful/himalaya-temple-mountains.jpg
Normal file
After Width: | Height: | Size: 943 KiB |
BIN
Colorful/japan-city-vibrant.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
Colorful/pink-red-lavafall.jpg
Normal file
After Width: | Height: | Size: 110 KiB |
BIN
Colorful/red-forrest-alley.jpg
Normal file
After Width: | Height: | Size: 916 KiB |
BIN
Gaming/hogwarts-legacy-wide.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
GruvBox/gruvbox-mkbhd.png
Normal file
After Width: | Height: | Size: 8.1 MiB |
BIN
GruvBox/gruvbox-pacman.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
GruvBox/gruvbox-space-chemistry.jpg
Normal file
After Width: | Height: | Size: 350 KiB |
BIN
Logos/arch-logo-purple.jpg
Normal file
After Width: | Height: | Size: 1.6 MiB |
BIN
Logos/unix-logo-distros-dark.jpg
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
Muted/Lofi-Cafe.jpg
Normal file
After Width: | Height: | Size: 956 KiB |
BIN
Muted/buildings.png
Normal file
After Width: | Height: | Size: 262 KiB |
BIN
Muted/cat_30.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
Muted/dark-alp-greenish.jpg
Normal file
After Width: | Height: | Size: 3.2 MiB |
BIN
Muted/evangelion.png
Normal file
After Width: | Height: | Size: 1.9 MiB |
BIN
Muted/lowpoly_street.png
Normal file
After Width: | Height: | Size: 372 KiB |
BIN
Muted/night_city.png
Normal file
After Width: | Height: | Size: 636 KiB |
BIN
Muted/pastel-window.png
Normal file
After Width: | Height: | Size: 2.3 MiB |
BIN
Muted/piexelgnome-dark.jpg
Normal file
After Width: | Height: | Size: 5.7 MiB |
BIN
Muted/planets-dark.png
Normal file
After Width: | Height: | Size: 356 KiB |
BIN
Muted/relaxed_mario.png
Normal file
After Width: | Height: | Size: 217 KiB |
BIN
Muted/rick-dark.png
Normal file
After Width: | Height: | Size: 323 KiB |
BIN
Muted/tokyo_pink.png
Normal file
After Width: | Height: | Size: 1,015 KiB |
BIN
Muted/vintage-style-moon-pyramids.png
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
Muted/yellow-flower.jpg
Normal file
After Width: | Height: | Size: 333 KiB |
BIN
Nordic/0kvzhru1ncua1.jpg
Normal file
After Width: | Height: | Size: 637 KiB |
BIN
Nordic/10.png
Normal file
After Width: | Height: | Size: 351 KiB |
BIN
Nordic/16.png
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
Nordic/1r1kk9qi00961.png
Normal file
After Width: | Height: | Size: 4.8 MiB |
BIN
Nordic/36.png
Normal file
After Width: | Height: | Size: 369 KiB |
BIN
Nordic/39.png
Normal file
After Width: | Height: | Size: 400 KiB |
BIN
Nordic/3xsraffkwi1a1.png
Normal file
After Width: | Height: | Size: 236 KiB |
BIN
Nordic/41.png
Normal file
After Width: | Height: | Size: 450 KiB |
BIN
Nordic/48.png
Normal file
After Width: | Height: | Size: 667 KiB |
BIN
Nordic/4w7e9vu1ncua1.jpg
Normal file
After Width: | Height: | Size: 1.7 MiB |
BIN
Nordic/50.png
Normal file
After Width: | Height: | Size: 611 KiB |
BIN
Nordic/53.png
Normal file
After Width: | Height: | Size: 537 KiB |
BIN
Nordic/54.png
Normal file
After Width: | Height: | Size: 533 KiB |
BIN
Nordic/59bsn5hgnojy.jpg
Normal file
After Width: | Height: | Size: 870 KiB |
BIN
Nordic/5qs71paaaic71.png
Normal file
After Width: | Height: | Size: 257 KiB |
BIN
Nordic/6c8sflehi3991.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
Nordic/73.png
Normal file
After Width: | Height: | Size: 11 MiB |
BIN
Nordic/9zr8j5xxjhca1.jpg
Normal file
After Width: | Height: | Size: 494 KiB |
BIN
Nordic/SBKjnxm.jpeg
Normal file
After Width: | Height: | Size: 857 KiB |
BIN
Nordic/at_the_coffeshop.png
Normal file
After Width: | Height: | Size: 1.7 MiB |
BIN
Nordic/bn2cm6gi26s81.jpg
Normal file
After Width: | Height: | Size: 504 KiB |
BIN
Nordic/cfe14jehi3991.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
Nordic/ciym5tjtnke51.jpg
Normal file
After Width: | Height: | Size: 471 KiB |
BIN
Nordic/container_ship.png
Normal file
After Width: | Height: | Size: 500 KiB |
BIN
Nordic/dsfshedsfgg.jpg
Normal file
After Width: | Height: | Size: 556 KiB |
BIN
Nordic/earth-in-space.png
Normal file
After Width: | Height: | Size: 995 KiB |
BIN
Nordic/ekn51fwc5me71.png
Normal file
After Width: | Height: | Size: 119 KiB |
BIN
Nordic/fmogxefycoqa1.png
Normal file
After Width: | Height: | Size: 407 KiB |
BIN
Nordic/frosted.png
Normal file
After Width: | Height: | Size: 813 KiB |
BIN
Nordic/gotu7byl4uua1.png
Normal file
After Width: | Height: | Size: 641 KiB |
BIN
Nordic/ign-0007.png
Normal file
After Width: | Height: | Size: 318 KiB |
BIN
Nordic/ign-0008.png
Normal file
After Width: | Height: | Size: 719 KiB |
BIN
Nordic/ign-0011.png
Normal file
After Width: | Height: | Size: 464 KiB |
BIN
Nordic/ign-76543.png
Normal file
After Width: | Height: | Size: 251 KiB |
BIN
Nordic/ign-8675.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
Nordic/ign_astronaut.png
Normal file
After Width: | Height: | Size: 517 KiB |
BIN
Nordic/ign_beyondHillAndDale.jpg
Normal file
After Width: | Height: | Size: 165 KiB |
BIN
Nordic/ign_bratislava.png
Normal file
After Width: | Height: | Size: 5.5 MiB |
BIN
Nordic/ign_car.png
Normal file
After Width: | Height: | Size: 831 KiB |
BIN
Nordic/ign_city.png
Normal file
After Width: | Height: | Size: 159 KiB |
BIN
Nordic/ign_cityRain.png
Normal file
After Width: | Height: | Size: 2.7 MiB |
BIN
Nordic/ign_cityRainOther.png
Normal file
After Width: | Height: | Size: 354 KiB |
BIN
Nordic/ign_colorful.png
Normal file
After Width: | Height: | Size: 2.1 MiB |
BIN
Nordic/ign_desert.png
Normal file
After Width: | Height: | Size: 4.2 MiB |
BIN
Nordic/ign_dudeOnBuilding.png
Normal file
After Width: | Height: | Size: 510 KiB |
BIN
Nordic/ign_dudeOnBuilding2.png
Normal file
After Width: | Height: | Size: 4.6 MiB |
BIN
Nordic/ign_dudeOnBuilding3.png
Normal file
After Width: | Height: | Size: 2.2 MiB |
BIN
Nordic/ign_evening.png
Normal file
After Width: | Height: | Size: 3.6 MiB |
BIN
Nordic/ign_farFromTomorrow.jpg
Normal file
After Width: | Height: | Size: 173 KiB |
BIN
Nordic/ign_furkaPass.jpg
Normal file
After Width: | Height: | Size: 368 KiB |
BIN
Nordic/ign_graySpaceship.png
Normal file
After Width: | Height: | Size: 304 KiB |
BIN
Nordic/ign_highTechGlobe.png
Normal file
After Width: | Height: | Size: 752 KiB |
BIN
Nordic/ign_legendary.png
Normal file
After Width: | Height: | Size: 703 KiB |
BIN
Nordic/ign_lighthouse.png
Normal file
After Width: | Height: | Size: 3.8 MiB |
BIN
Nordic/ign_mandalorian.jpg
Normal file
After Width: | Height: | Size: 166 KiB |
BIN
Nordic/ign_mountains.jpg
Normal file
After Width: | Height: | Size: 347 KiB |
BIN
Nordic/ign_mountains.png
Normal file
After Width: | Height: | Size: 3.3 MiB |
BIN
Nordic/ign_outer_space.png
Normal file
After Width: | Height: | Size: 2.5 MiB |
BIN
Nordic/ign_planets.jpg
Normal file
After Width: | Height: | Size: 93 KiB |
BIN
Nordic/ign_street-crossing.png
Normal file
After Width: | Height: | Size: 684 KiB |
BIN
Nordic/ign_sunAndClouds.png
Normal file
After Width: | Height: | Size: 2.1 MiB |
BIN
Nordic/ign_sunGarden.png
Normal file
After Width: | Height: | Size: 2.2 MiB |
BIN
Nordic/ign_sunset.png
Normal file
After Width: | Height: | Size: 249 KiB |