Wednesday, 10 May 2017

How to set X properties in order to create a desktop status bar with electron?

I want my window manager (xmonad) to manage my electron app as a desktop status bar : it must be available on any workspace and have a reserved place on the screen (in the top for exemple)

To achieve this, I created a BrowserWindows like this :

mainWindow = new BrowserWindow({
    x:0,
    y:0,
    width:1024,
    height: 30,
    frame: false,
    title: 'electron-status-bar',
    type: 'dock'
});

My bar is visible on any workspace and above the other window. But it still have no reserved place, so there are overlaps with other windows.

I used xprop to compare with dzen2 (the actual status bar that perfectly work), and dzen2 have these properties :

_NET_WM_STRUT(CARDINAL) = 0, 0, 0, 34
_NET_WM_STRUT_PARTIAL(CARDINAL) = 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 899

In fact, the xmonad plugin (ManageDock) that manage the overlap is watching these two properties to calculate the window positions.

There is a way to set such properties in my electron app ?



via Alexandre Brach

No comments:

Post a Comment