Improve the wallpaper script
This commit is contained in:
parent
4e8dd3ad51
commit
07a91ea136
2 changed files with 18 additions and 4 deletions
|
@ -43,7 +43,7 @@ $lock = swaylock --color=000000 --daemonize
|
||||||
# exec-once = $terminal
|
# exec-once = $terminal
|
||||||
# exec-once = nm-applet &
|
# exec-once = nm-applet &
|
||||||
# exec-once = waybar & hyprpaper & firefox
|
# exec-once = waybar & hyprpaper & firefox
|
||||||
exec-once = ~/.local/bin/set_wallpaper && hyprpaper
|
exec-once = ~/.local/bin/set_wallpaper
|
||||||
exec-once = waybar
|
exec-once = waybar
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,22 @@
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
|
|
||||||
WALLPAPER_DIRECTORY="$HOME/pictures/wallpapers/enabled"
|
|
||||||
HYPRPAPER_CNF="$HOME/.config/hypr/hyprpaper.conf"
|
HYPRPAPER_CNF="$HOME/.config/hypr/hyprpaper.conf"
|
||||||
|
WALLPAPER_DIR="$HOME/pictures/wallpapers/enabled"
|
||||||
|
WALLPAPER_DIR_WINTER="$WALLPAPER_DIR/winter"
|
||||||
|
|
||||||
if [ -d "$WALLPAPER_DIRECTORY" ]; then
|
# Set the wallpaper directory based on the current month
|
||||||
WALLPAPER_FILE="$(find "$WALLPAPER_DIRECTORY" -type l -print | shuf | head -n 1)"
|
case "$(date '+%m')" in
|
||||||
|
"01"|"02"|"11"|"12")
|
||||||
|
if [ -d "$WALLPAPER_DIR_WINTER" ]; then
|
||||||
|
WALLPAPER_DIR="$WALLPAPER_DIR_WINTER"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Generate the configuration
|
||||||
|
if [ -d "$WALLPAPER_DIR" ]; then
|
||||||
|
WALLPAPER_FILE="$(find "$WALLPAPER_DIR" -maxdepth 1 -type f -print | shuf | head -n 1)"
|
||||||
if [ -L "$WALLPAPER_FILE" ]; then
|
if [ -L "$WALLPAPER_FILE" ]; then
|
||||||
WALLPAPER_FILE="$(readlink -f "$WALLPAPER_FILE")"
|
WALLPAPER_FILE="$(readlink -f "$WALLPAPER_FILE")"
|
||||||
fi
|
fi
|
||||||
|
@ -17,3 +28,6 @@ wallpaper = ,$WALLPAPER_FILE
|
||||||
splash = false
|
splash = false
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set the wallpaper
|
||||||
|
hyprpaper
|
||||||
|
|
Loading…
Add table
Reference in a new issue