-
-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shuffle random wallpaper #194
Comments
edit the config with something like sed and then launch? |
Just adding a working example snippet from my config. $SCRIPTS_DIR/pick_wallpaper.sh: # Pick random wallpaper
random_pick=$(find "$wp_dir" -type f -name "*.png" -o -name "*.jpg" | shuf -n1)
# Replace the placeholder in template and save to .conf file
sed -e "s~<wp>~${random_pick}~g" $conf_dir/templates/hyprpaper.template > $conf_dir/hyprpaper.conf $conf_dir/templates/hyprpaper.template:
then just exec-once it
|
@jerilMJ thanks for that simple but effective solution. Simple keybinding to load random wallpaper in
|
An extremely simple script could do this for you: #!/usr/bin/env bash
WALLPAPER_DIR="$HOME/walls/images/"
CURRENT_WALL=$(hyprctl hyprpaper listloaded)
# Get a random wallpaper that is not the current one
WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" | shuf -n 1)
# Apply the selected wallpaper
hyprctl hyprpaper reload ,"$WALLPAPER" no need to modify the config or preload anything or restart hyprpaper. |
That's a good solution, if you don't want the change to be persistent. jerilMJ's solution is on point for changing the default wallpaper as the change is persistent after restart. |
does that not defeat the purpose of it being randomised? If you were to save the wallpaper isn't that just a less convenient wallpaper picker? |
No, since I like to pick a random wallpaper from time to time, but not after every reboot. |
ok, then you can pick a wallpaper, symlink it somewhere like #!/usr/bin/env bash
WALLPAPER_DIR="$HOME/walls/images/"
WALL_LOC="$XDG_STATE_HOME/wallpaper"
# Get a random wallpaper that is not the current one
WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$(readlink -e $WALL_LOC)")" | shuf -n 1)
# symlink somewhere
ln -sf $WALLPAPER $WALL_LOC
# Apply the selected wallpaper
hyprctl hyprpaper reload ,"$WALLPAPER" |
You really don't like the idea of modifying the config and restarting hyprpaper hahaha |
you're right xd sed'ing the config file and then restarting hyprpaper is just really hacky tbh. I assume you lose the nice animation when switching wallpapers if you did it like that. I mean if it works for you then sure, go for it, but imo there are better methods than sed'ing and restarting |
Yeah, you're right, reloading looks like the way to go. |
To randomly pick (shuffle) a wallpaper out of a set of wallpapers, I had
How can this be accomplished with
hyprpaper
?I want to avoid preloading all.
The text was updated successfully, but these errors were encountered: