hyprwm / hyprpaper

Hyprpaper is a blazing fast wayland wallpaper utility with IPC controls.
https://wiki.hyprland.org/Hypr-Ecosystem/hyprpaper/
BSD 3-Clause "New" or "Revised" License
773 stars 54 forks source link

Unloading after setting the wallpaper #20

Closed Jacob3075 closed 1 year ago

Jacob3075 commented 1 year ago

I went through the readme and I found consider unloading those that you no longer need but I'm not sure what no longer needed means. Does it mean that once I set the wallpaper I can unload it

eg flow:

hyprctl hyprpaper preload ~/Pictures/myepicpng.png
hyprctl hyprpaper wallpaper DP-1,~/Pictures/myepicpng.png
hyprctl hyprpaper unload ~/Pictures/myepicpng.png

Will the above cause any issues?

vaxerski commented 1 year ago

shouldnt. Try it

Jacob3075 commented 1 year ago

Yeah I tried it later, forgot to update.

If I execute them manually it seems fine, the wallpaper is still set, but if I run it as part of a script hyprpaper crashes. I'm guessing it's because the image is unloaded before it actually gets set.

Jacob3075 commented 1 year ago

Is there any way where we can have only one image loaded at a time, like a setting in the config or a flag that unloads the previous image when preloading a new one?

Cause in my use case I'm using an app called variety to set my wallpapers and it calls a script (with the path to the new wallpaper) that checks the DE/WM and sets the wallpaper. I don't have access to the previous image in this case so something like this would be useful, or like #19 would also work ig.

vaxerski commented 1 year ago

unload all added in 3571e20b55da7921a47d4910204b40ab1701b5c4

Close if you wish.

Wa1t5 commented 1 year ago

@Jacob3075 I wrote a script for using one wallpaper at a time #21

Jacob3075 commented 1 year ago

@vaxerski I just checked the commit changes, shouldn't this be called in handleUnload https://github.com/hyprwm/hyprpaper/blob/3571e20b55da7921a47d4910204b40ab1701b5c4/src/config/ConfigManager.cpp#L115

right now it's in handleWallpaper so I think the command it matches is ... wallpaper all instead of ... unload all. If it's fine then I'll close it.


@Wa1t5 I checked script, it might work but I feel like there's better ways to it

Wa1t5 commented 1 year ago

@Jacob3075 Yep, I updated it to use hyprctl, but I still need to commit, I'll do it tomorrow have to sleep now

vaxerski commented 1 year ago

@Jacob3075 my retardness. Fixed.

Jacob3075 commented 1 year ago

Cool, thanks 👍👍