Rofi on wayland and plugins

Since wofi is not maintained anymore, I moved back to rofi, and in particular its Wayland port that has recently (?) appeared in unstable.

But now I also noticed the various rofi-calc etc, and I wanted to give it a try. However, they don’t seem to work. I assume it’s because they have the original (non Wayland) rofi as input of the derivation, to do things like this.

Now my question: assuming I want to try to adapt it, what would a good way of making this general be?

  • adding a rofiPackage parameter to the derivation?
  • doing something similar to kodi.withPlugins?
  • is there a global flag saying “use wayland”?

I ran into the same, have you hacked a solution “already”?

I guess the quick&dirty option is to override most of the wayland derivation to do the wrapping as in the normal package, but I’d say (since multiple plugins are supported by the config) it would be better to get rid of the wrapper entirely and rely on config generation (e.g. as in HM) to specify the plugins.

Currently the HM module is “not smart enough” to handle the plugins option for rofi-wayland, since it just overrides its plugins attribute which is not handled in the package. Si instead it would be better if the HM module just modifies the generated config to map over the plugin package paths and include it.

I’m running into this issue now too. As a novice I’m not at the level yet where I can write a derivation. Can you give an example of how to apply the workaround?

Or perhaps we’re able to create an issue or pull request on the HM GitHub, and mention the maintainer, to get a proper fix?

I don’t know in detail how the home-manager module works, or these rofi plugins, but a workaround that should work pretty much anywhere is this:

nixpkgs.overlays = [(final: prev: {
  rofi-calc = prev.rofi-calc.override { rofi-unwrapped = prev.rofi-wayland-unwrapped; };
})];

And yeah, if there’s no issue about this upstream yet, I’d create one.

That’s a good starting point. Looking at the source code of the rofi and rofi-wayland packages I don’t quite yet understand how they each deal with plugins, let alone how to fix it. Have to look into it a bit more.

i tried to file an upstream issue for this at rofi plugins and rofi-wayland · Issue #265122 · NixOS/nixpkgs · GitHub

hm, admittedly rofi -show calc appears to run for me. is there still more to be fixed here?