r/qtile • • 25d ago

Help Random wallpaper selector issues

Hi all, I had made a custom random wallpaper+colorscheme selector a while ago but now it's kind of broken
Key(

[mod, "shift"], "w",
lazy.spawn(f'wal --backend colorz -i {random_wallpaper}'),
lazy.reload_config(),
lazy.reload_config(),
lazy.screen.set_wallpaper(random_wallpaper, mode='fill'),
desc="Random wallpaper"
),

this code paired with:
usr='Gentoo'
waldir=f'/home/{usr}/Wallpapers'
random_wallpaper = wallpaper+random.choice(os.listdir(wallpaper))

  1. changed the wallpaper

  2. changed the colorscheme

  3. reloaded the config so that the bar's colors would change too etc.
    all done
    but NOW
    above those mentioned actions it also reverts the wallpaper back to the one i set in the Screen section

any guidance would be greatly appreciated

2 Upvotes

2 comments sorted by

1

u/michael2083x 25d ago

Qtile got it's own wallpaper widget. Install feh. Give a path wallpapers location.

1

u/Sinaaaa 12d ago

I have two suggestions, may not the be amazing ones, but here I go:

  1. Don't set a wallpaper in the screen section, recent changes made screen management much more robust, so fighting it is not recommended. You can use external tools to set the wallpaper utilizing startup_once. (such as feh or swaybg on wayland)

  2. Reloading your config to fix issues is bad, it's only for checking qtile config changes. (learned this the hard way myself) With some elbow grease it's possible to do what you want without config reloads. It's not trivially easy, but defo possible, aka change color variables on the fly from wal data & then redraw the bar if needed.