Skip to content

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

Merged
InioX merged 3 commits intomainfrom
unknown repository
Oct 26, 2024
Merged

Feat: Remove reload_apps-related functionality and add a config.wallpaper section#113
InioX merged 3 commits intomainfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost 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"
  ];
};

@ghost ghost 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
@DaniD3v
Copy link
Copy Markdown
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.

@ghost
Copy link
Copy Markdown
Author

ghost 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
Copy Markdown
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?

@ghost
Copy link
Copy Markdown
Author

ghost 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

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.

3 participants