soumya92/barista

Module contributions

martinohmann opened this issue · 4 comments

I have written some modules which I keep in a repository together with my bar configuration. Some of them are currently in a good enough state that I'd like to contribute them.

  • dpms: Displays the current DPMS state in the bar and lets you toggle DPMS via bar clicks. Currently implemented providers:
    • xset: query and set DPMS state via xset.
  • ip: Displays the current public IP in the bar if connected to the internet. Currently implemented providers:
  • keyboard: Displays the currently set keyboard layout in the bar. It accepts a list of user-defined keyboard layouts that can be cycled through when clicking the bar segment. Currently implemented providers:
    • xkbmap: query and set keyboard layouts using setxkbmap.
  • updates: Displays the number of currently available package updates in the bar. Can optionally also display the package name + current/target versions for which updates exist. Currently implemented providers:
    • pacman: query for pacman updates using checkupdates from pacman-contrib.

You can find the modules here: https://github.com/martinohmann/i3-barista in the modules package.

Let me know if you are interested in any of them to be part of barista itself, then I'll polish them off and create some PRs :).

The modules look great! I'm glad to see you find this project useful enough to put in the effort of writing your own :)

I think one of strengths of go is its import system, where you can import "github.com/martinohmann/i3-barista/modules/keyboard" right next to import "barista.run/modules/weather".

It was certainly my hope when I started with this that anyone who wrote modules that they found useful would be able to just make them available without needing to send PRs against this repository. However this is the first time I've seen modules available externally.

If you don't mind maintaining them in your repository, I think what I would prefer is that you send a pull request against the gh-docs branch adding a list of community-contributed modules with your four modules, so that we have a good place to add future extensions, and provide visibility to modules that are generally useful.

Hey @soumya92, I'm glad you like them! I don't mind to maintain them in my own repository. Crosslinking community modules in the gh-docs certainly sounds like I good idea :).

But I'll probably move them to a barista-contrib repo to have them separate from my personal bar implementation. How would you go about documentation of usage examples for community modules? Should this be part of the barista gh-docs? I think it probably makes sense to keep module documentation in my own repository so I can change it together with the code. I'd probably just add links to them and provide a one-sentence description as you are doing with the built-in modules.

Looking forward to hear your opinion.

Yep, one-line description with link to your docs sounds perfect. Thanks!

The update to docs is now live.