Modular structure for Limepanel

I would like to customize limepanel so that it would be easier to add or remove it’s elements. I borrowed some code from limepanel and tried to make a simple modular panel. It is just a sketch and my shell scripting skill is low, but it works on my single monitor system.

simplepanel.sh

2 Likes

I will test it ASAP. The code looks much cleaner, I hope nothing is missing…

1 Like

Interesting approach.

With limepanel the goal was minimal resource usage, which is why it was written in dash instead of bash, dropped conky, did not loop to update volume and had long update interval in general.

But this aims more for configurability. I like your idea.

Suggestion: you could use configuration file like limepanel does, to set update interval, colors and fonts. And in your case also to choose modules. You could also make it source some configuration directory, where plugins could be just dropped in by user or installed by other packages.

How much ram does this consume by the way?

1 Like

I will experiment with it later. I will try to add config in a separate file. If used without conky and clock it will update only on events, no timed update is needed.

Sweet!

hmm… 10 processes, but without conky its still only 2.2mb + xtitle. I wonder if there would be a way to port it to dash… There is at least that array there…

[runs checkbashisms]
Okay, other than finding alternative solution to that plugin array, it should be wasy to port to dash. Definately interested in this =)

1 Like

I think it is possible to emulate (replace) the modules aray with a string containing a list of modules separated by comma or colon and also use a string and not an array to store current values.

Then we could port it to dash to make it even lighter. And make it generate its configuration file when first run like limepanel. It would be really nice to package this then :slight_smile:

1 Like

I think strings with newline separated fields will do both for modules list and for current values list. I’ll try to rewrite the script when I find some free time.

I ported it to dash. It almost works, but swallows first and last spaces in modules. Still can’t figure out how to fix it.

Simple panel in dash

The code is less clear but I hope it is more efficient.

EDIT. I think I will add a nonspace character at the beginning and at the end of stored module values to protect spaces and then remove them when printing.

1 Like

Looks terrific!

1 Like

I’ve fixed spaces problem. Now it works.

http://pastebin.com/Dd0VsZ0A

It would be nice to spawn only dynamic modules. Still want to know how to do that.

1 Like

What do you mean by dynamic modules?

Btw, do you plan on putting this to github? It would make packaging easier later.

Dynamic modules continue to update their text like xtitle or conky. Static modules always keep the same text like menu button or separator.

Maybe. I haven’t used github yet.

Now it is here

1 Like

Cool! Do you want me to write a PKGBUILD for it?

Yes, pIease, though some features are still missing, like battery and volume indicators, separate config file. Maybe I’ll add them sometime.

Okay, I’ll add it when I get the opportunity. I’ll make one that just installs everything you put in that /bin directory to /usr/bin.

If this is going to be as awesome as it seems to be shaping up to be, I might put it on the next bspwm edition.

1 Like

I’ve managed to write PKGBUILD by myself (modified one from your package).
Now the panel looks like this

1 Like

I have finished all major features of the panel. Menu button, bspwm desktop info, focused window title, system status line (wifi info, sound volume, backlight, battery level, clock). Status line has modular structure too, and it combines all its modules in one process in order to consume less resources. Interactive elements (volume, backlight) update at once while in the process of interaction, but they update slowly when there is no interaction.
The panel takes 11 processes when running and xtitle, lemonbar, bspc subscribe. I still have to figure out how to avoid spawning unneeded processes from clickable lemonbar areas.

2 Likes

Forum kindly sponsored by