Bmpanel2 update

First of all, I’d like to start from bugs that were fixed (or at least I think they were). There was a bug with clock text and I thought it was fixed long time ago, but it wasn’t. In this patch set I did few more updates to that code and now, finally, I think it works fine. Please, if you see this glitch again after the update, let me know.

And now let’s talk about multihead support. Basically I decided to fully implement xinerama/xrandr dependent functionality and here how it works:

  1. There are a lot of words: Xinerama, XRandR, TwinView, etc. but almost all of them about the same. Technically, all I need to know about your system is how many monitors you have and what their geometry/position are. I can use two X extensions to retrieve that kind of information: XRandR or Xinerama. I prefer Xinerama (CMake option: BMPANEL2_FEATURE_XINERAMA) currently, and XRandR is disabled by default (CMake option: BMPANEL2_FEATURE_XRANDR). Yes, I know that Xinerama is declared as deprecated, but currently I think it works well even when your system is configured with XRandR. However, bmpanel2 coded in a way that it can use both, just enable them both if you want. But still, preference is given to the Xinerama and if it is enabled on your system it will be used instead of XRandR (unless you have disabled Xinerama completely of course). So, if something went wrong, try ON/OFF these options (you can do it using cmake command line like that: cmake -DBMPANEL2_FEATURE_XRANDR=ON -DBMPANEL2_FEATURE_XINERAMA=OFF).
  2. There is a problem with “strut” thing. If you’re interested in details read NETWM standard (just search for “strut” there). As user all you want to know that it is a bad choice to place the bmpanel2 between monitors (for example if you have one monitor on top of another). If you do, your windows will cover the panel in the maximized mode. It’s because standard currently doesn’t allow to deal with this situation properly. In other words – panel should stay on the edge of the combined virtual screen. If you still don’t know what I’m talking about, see this image showing hypothetic monitors array (green are good positions, red are bad positions, blue are monitors):
  3. The next issue is Window Managers. I checked few, and here is the list of working ones:  Openbox, Fluxbox, Xfwm4. These are not working properly: IceWM, PekWM. I guess my priority is standalone window managers like Openbox and PekWM, but in that case I can’t do anything about PekWM, ask its authors to implement full support of a _NET_WM_STRUT_PARTIAL and proper work with multiple monitors (e.g. maximizing windows accordingly). Also there are few minor differences in WMs behaviour, for example some of the WMs keep sending window position changes while you’re moving a window (IceWM, PekWM, Xfwm4), others send these notifications only when you have released a window (Openbox, Fluxbox) and it affects panel in a way that tasks move on another monitor only when the panel is being notified that windows had been moved. But that’s a minor issue I guess.
  4. And finally, the User Guide or what you need to know as a bmpanel2 user. First let’s see a brief list of changes:
    • Bmpanel2 now doesn’t take into account the current workspace bounds. It means that you can’t stack panels one on top of another anymore. This feature was a hack and isn’t described anyhow in the NETWM standard. Maybe It will be back in the future.
    • Clock text bug fix (was mentioned in the beginning of the post).
    • Added new option to the bmpanel2 config and bmpanel2cfg utility: monitor. It allows you to specify on which monitor bmpanel2 should reside (starting from 0). Currently it isn’t possible to span bmpanel2 across monitors (well, unless you have disabled XRandR and Xinerama code completely).
    • Added new command line option to the bmpanel2: –config. Which allows you to override default config file. I recommend you to use full paths here always.
    • Now it is possible to specify the config file path in the bmpanel2cfg as a first command line argument when you’re running it (for example: bmpanel2cfg /path/to/non/default/configrc). It is used in pid (process id) searching algorithm. Basically it check if there is a running panel that was started with that config file as an argument and uses it as a target to send reload requests to. With this feature it is possible to use bmpanel2cfg with different instances of bmpanel2.
    • New cmake build options (these are booleans): BMPANEL2_FEATURE_XRANDR (off by default) and BMPANEL2_FEATURE_XINERAMA (on by default). They were described above.
    • Added new option to the bmpanel2 config and bmpanel2cfg utility: task_visible_monitors. You should read it as: Task is marked as visible if it is located on one of these monitors. This option basically a string of space separated numbers (for example: task_visible_monitors 0 1, means that windows from the first and the second monitor will be shown as tasks on the taskbar). There is one restriction however, current maximum number of monitors which this option can handle is 32. If anyone has X11 and bmpanel2 running on more that 32 monitors, please send me a photo of your *uhm* array of monitors and I will fix it for you immediately ;-).
    • New taskbar task visibility logic. By default taskbar shows only tasks from the current monitor (specified by monitor option). But you can customize this behaviour using task_visible_monitors option as described above.

    Ok, now what you need to do to start these things up. I will show you on a two monitors example. Let’s suppose we have monitor 0 and 1 (in terms of bmpanel2):

    • 1. We need to copy a usual bmpanel2 config file for a second monitor:
    • cp ~/.config/bmpanel2/bmpanel2rc ~/.config/bmpanel2/bmpanel2rc_mon1
    • 2. Then open if with your preferred text editor (I use vim):
    • vim ~/.config/bmpanel2/bmpanel2rc_mon1
    • 3. Add the monitor option here at the end of the file:
    • monitor 1
    • 4. Now you’re ready to run:
    • bmpanel2 &
    • bmpanel2 --config ~/.config/bmpanel2/bmpanel2rc_mon1 &

    Also of course you can modify a theme in this second config file. Or even copy a theme to your ~/.local/share/bmpanel2/themes dir and modify/rename it slightly. For example you might want to remove some widgets from it and/or change the position. If you want to configure your second panel instance with bmpanel2cfg, just use it’s config file as a first argument for bmpanel2cfg utility: bmpanel2cfg ~/.config/bmpanel2/bmpanel2rc_mon1. But don’t forget that it is the shell what changes the “~” to your HOME directory. If you want to add the bmpanel2cfg to let’s say a launch bar, you should use full path (e.g. bmpanel2cfg /home/nsf/.config/bmpanel2/bmpanel2rc_mon1).

And at the end I’d like to say that currently bmpanel2 isn’t actively developed. I’m making changes when there is something that I don’t like, so don’t be mad at me because I’m refusing to implement your feature. But I like to fix bugs, because they are quite challenging and interesting tasks by themselves. Some bugs are much harder to fix than another, so it may take time. Well, that is all I wanted to say. Happy bmpanel2 using.

P.S. Patches were uploaded to the upstream git repositories.


9 Responses to “Bmpanel2 update”

  1. Josep Andreu Says:

    Hi .

    I use Twinview and PekWM with two monitors, I was scared when I was compile the repository, and scared also reading the web, just happy when I read the blog and I see the new config parameters. Thanks for this new features, that really helps.

    Perhaps you can include some ChangeLog or some NEWS in the git repository 🙂



    • nsf Says:

      Well, if you use git version it is supposed that you’re following the project development. And I write everything important I do in this blog. Also I’m trying to expand my commit comments writing skill, but there are a lot of techincal info.

      I don’t like ChangeLog and NEWS files. But I’ll think about it. Maybe I will make them at least for version releases.

  2. frenzy Says:

    I installed bmpanel2-git from AUR and I have to say the clock text bug is still present. I tried to set

    time_format %a %d/%m/%y %H:%M:%S

    in your Transpy theme file (i’m using it; very good theme ;)) in the correct clock section next to background and font configuration but the output format doesn’t change; no matter what time_format I specify in the theme file.

    • nsf Says:

      There is no such bug, you’re doing something wrong.

      • nsf Says:

        I don’t know what can it be.. Maybe your editor uses spaces instead of tabs, maybe you’re not reloading theme at all.

        I have just checked your time_format parameter, works for me..

  3. frenzy Says:

    Yeah… you’re right. I configured Vim to uses spaces instead of tabs. I copied again theme file from /usr/share… in my .local folder and then edited it with nano.

    Now it works.


    • nsf Says:

      Spaces actually ok too, but theme files have to be consistent. Bmpanel2 treats single space as 1 indent level and a single tab as 1 indent level. And of course it’s a good idea to have only spaces or only tabs inside a theme file.

      Bad things happen usually when someone decides to edit other’s people themes. 🙂

  4. markand Says:


    Can we run bmpanel on other OS than linux now or not ? 😉

    If you don’t remember, I asked you a long time ago why I need glibc and linux kernel and you said “you need it for the main loop”. Then I told you there is other systems than linux.

    You answered me “I don’t care about portable software” 😉


    • nsf Says:

      It was true for bmpanel version 0.9.x long time ago. And even at that time it was possible to configure it using different build flags (–with-event or –with-ev) and therefore avoid requirement of linux kernel. Bmpanel2 may work on other OS probably, it uses only glib library (from gtk project, don’t confuse it with glibc) main loop. What I meant by “I don’t care about portable software” is that I don’t develop bmpanel in a crossplatform manner and obviously I haven’t tested it on other OSes.

      The proper answer to your question is: Maybe, why don’t you try it?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: