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

Feat: Remove reload_apps-related functionality and add a config.wallpaper section #113

Merged
merged 3 commits into from
Oct 26, 2024

Conversation

ys5g
Copy link
Contributor

@ys5g ys5g commented Oct 18, 2024

Makes way for #68 and makes #94 obsolete
Basically, it adds a config.wallpaper section and removes the config.reload_apps option and the entire config.reload_apps_list section.
The path to the image doesn't need to be specified in config.wallpaper.arguments. It'll be the last argument provided to the command automatically
Example configuration:

[config.wallpaper]
arguments = ["img", "--transition-type", "center"]
command = "swww"
set = true

[templates.gtk3]
input_path = "./templates/gtk.css"
output_path = "$HOME/.config/gtk-3.0/gtk.css"
[templates.gtk4]
input_path = "./templates/gtk.css"
output_path = "$HOME/.config/gtk-4.0/gtk.css"
Nix configuration(at least with #68)
programs.matugen.settings.config.wallpaper = {
  set = true;
  command = "${lib.getExe pkgs.swww}";
  arguments = [
    "img"
    "--transition-type"
    "center"
  ];
};

@ys5g ys5g changed the title Feat: Remove reload_apps-related functionality and Feat: Remove reload_apps-related functionality and add a config.wallpaper section Oct 18, 2024
@InioX InioX merged commit 3b9c1db into InioX:main Oct 26, 2024
ys5g added a commit to ys5g/matugen-themes that referenced this pull request Oct 27, 2024
@DaniD3v
Copy link
Collaborator

DaniD3v commented Oct 27, 2024

How could I add a reload_app hook here?
I can't execute 2 commands with this, right?

I know it's a bit late for discussion now but I would've preferred using the templating engine on commands as well rather than just having an args array and adding the image path at the end. Take a look at this use case for example:

PRIMARY_COLOR=$(${pkgs.matugen}/bin/matugen image ''${wallpaper} --json strip | ${pkgs.jq}/bin/jq -r ".colors.light.primary")
asusctl led-mode static -c "$PRIMARY_COLOR" # asusctl is installed system-wide so I can't use an absolute path.

This would be 30 times easier with a hook that can be templated.

@ys5g
Copy link
Contributor Author

ys5g commented Oct 27, 2024

reload_apps wasn't customizable for the end-user anyway. Also, why would you execute 2 commands to set a wallpaper? I only included config.wallpaper.pre_hook, which supports running multiple commands but not templating, so you can pkill your wallpaper daemon.
Also, unless I'm missing something, that code block doesn't have anything to do with setting a wallpaper or reload_apps so IDT this PR affected your ability to run that.

@DaniD3v
Copy link
Collaborator

DaniD3v commented Oct 27, 2024

Isn't the thingy that sets a wallpaper basically just a pre_hook? Why not just add templating there and remove this entirely?

@ys5g
Copy link
Contributor Author

ys5g commented Oct 27, 2024

If you mean using templates, you need input_path and output_path, which doesn't make sense with wallpapers. If you mean adding a config.run_after option that accepts templating and multiple commands, it looks like that was considered but then removed(wiki link).
At the end of the day, it seems like multiple ways of doing the same thing so idk

ys5g added a commit to ys5g/matugen-themes that referenced this pull request Nov 5, 2024
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

Successfully merging this pull request may close these issues.

4 participants