InioX / matugen

A material you color generation tool
GNU General Public License v2.0
328 stars 16 forks source link

Wallpaper setting locks until a hook finishes #130

Open Axenide opened 2 days ago

Axenide commented 2 days ago

Hi, I've been using Matugen lately and I love it.

One thing I just noticed is that when a hook is running, Matugen waits for it to finish before setting the wallpaper.

For example, using this config sets the wallpaper after 5 seconds:

[config]
reload_apps = true

[config.reload_apps_list]
kitty = true
gtk_theme = true

[config.wallpaper]
command = "swww"
arguments = ["img", "-t", "outer", "--transition-duration", "1", "--transition-step", "255", "--transition-fps", "60", "-f", "Nearest"]
set = true

[templates.hyprland]
input_path = '~/.config/matugen/templates/hyprland-colors.conf'
output_path = '~/.config/hypr/source/colors.conf'
post_hook = "sleep 5"

Of course I don't have a random sleep command there, but I have others like walogram that takes around 3 or 4 seconds to generate a colorscheme for Telegram, which is really noticeable. Can this be async in any way? Am I missing something?

Thank you for creating such a great tool!

Axenide commented 1 day ago

Just in case this is useful to anyone, adding & at the end of the hook makes it async, just like in the command line.