wrapper-manager icon indicating copy to clipboard operation
wrapper-manager copied to clipboard

wrappers.<name>.programs attrset

Open nrabulinski opened this issue 1 year ago • 6 comments

Closes #14

Added new API which allows to wrap specific programs. By default top-level wrapper options are merged with the specific ones for the program. One can override this behavior by using lib.mkForce or other overrides. Deprecated renames in favor of explicitly setting programs.<name>.target and added a deprecation message.

Pls test thoroughly before merging thanks

nrabulinski avatar Feb 09 '24 21:02 nrabulinski

Thank you very much for keeping the project alive. The idea lgtm, the only thing: do you plan to add something else to a program type? Seems kinda empty to just hold a name and a target.

I'll use the pr for my dotfiles and report back.

viperML avatar Feb 10 '24 17:02 viperML

do you plan to add something else to a program type? Seems kinda empty to just hold a name and a target.

I was planning on also having a way to define desktop items per program, though I'm not sure if that's the best way of doing it. The idea would be to have the program arguments and then for every desktop item you could append additional arguments and/or environment variables or overwrite them.

nrabulinski avatar Feb 10 '24 18:02 nrabulinski

I was planning on also having a way to define desktop items per program

I guess we may run into problems by doing this. I believe there are applications with multiple .desktop files for each /bin/{name} entry (like with different launch flags or modes).

viperML avatar Feb 11 '24 10:02 viperML

Adding to that, I think it is better to think of an ergonomic API, and then think about the implementation

viperML avatar Feb 11 '24 10:02 viperML

I was planning on also having a way to define desktop items per program

I guess we may run into problems by doing this. I believe there are applications with multiple .desktop files for each /bin/{name} entry (like with different launch flags or modes).

Yes, which is exactly why desktop items would be defined per program, and not per wrapper. I.e. something like

{
  wrappers.chrome = {
    programs.google-chrome = {
      desktop-items.apple-music = {
        name = "Apple Music";
        appendFlags = [...];
      };
    };
  };
}

Of course this is a very rough sketch but I think you get the idea

nrabulinski avatar Feb 11 '24 10:02 nrabulinski

How would makeDesktopItem fit in there? https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/make-desktopitem/default.nix

viperML avatar Feb 11 '24 12:02 viperML