dotfiles/scripts/changewallpaper.sh
2024-10-08 22:47:49 +03:00

18 lines
501 B
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
DIR=$HOME/Desktop/wallpapers
PICS=($(ls ${DIR}))
# Select a random wallpaper
RANDOMPICS=${PICS[$RANDOM % ${#PICS[@]}]}
# Notify the user about the wallpaper change
dunstify "⬅Changed" -a "Wallpaper" -u "low" -i ${DIR}/${RANDOMPICS} -r "1234"
# Preload the selected wallpaper and set it as the wallpaper
hyprctl hyprpaper preload "${DIR}/${RANDOMPICS}"
hyprctl hyprpaper wallpaper ",${DIR}/${RANDOMPICS}"
# Play a notification sound
canberra-gtk-play -i window-attention