Skip to content
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

Open
aloispichler opened this issue Aug 24, 2024 · 2 comments
Open

shuffle random wallpaper #194

aloispichler opened this issue Aug 24, 2024 · 2 comments

Comments

@aloispichler
Copy link

aloispichler commented Aug 24, 2024

To randomly pick (shuffle) a wallpaper out of a set of wallpapers, I had

exec-once=swaybg -i $(shuf -n1 -e /usr/share/backgrounds/xfce/ArchSimple.png /usr/share/backgrounds/xfce/arch2024.jpg /usr/share/backgrounds/xfce/arch2023.jpg /usr/share/backgrounds/xfce/arch10.jpg)

How can this be accomplished with hyprpaper?
I want to avoid preloading all.

@vaxerski
Copy link
Member

edit the config with something like sed and then launch?

@jerilMJ
Copy link

jerilMJ commented Sep 2, 2024

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:

$wp = <wp>
preload = $wp
wallpaper = , $wp

then just exec-once it

exec-once = $SCRIPTS_DIR/pick_wallpaper.sh && hyprpaper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants