I have a desktop spanning two monitors

The right monitor is in standby mode (screen is black) and is activated only when needed

Sometimes, an app opens on the right monitor while in standby mode and happens to get unnoticed

How can I determine if any app runs on the right monitor?

Debian 11.5 Bullseye, Openbox, LXDE, tint2

Side notes:

I have configured "separate taskbars": apps on the left monitor appear in the left taskbar, apps on the right monitor appear in the right taskbar

If I let all apps appear in the left taskbar, an app on the right monitor would not get unnoticed, but the separation of the taskbars should not be changed

Also, if I middle-click the desktop, any app on the other monitor would be shown, but I need to be aware of needing to do that

  • 1
    You might be able to do something with devilspie2 which can listen for window create events and do then something. You need to code in lua.
    – meuh
    Sep 29, 2022 at 18:22

1 Answer 1


Thanks to the tip from @meuh, I inspected devilspie2, then devilspie, then I got aware of having to query the X window ids, which I tried unsuccessfully with xwininfo, then xdotool, and then successfully with wmctl:

wmctrl -l -G

delivers the geometry of all active windows with the x value in the third column (output shortened):

0x0300000e  0 190  ...
0x0340000e  0 2110 ...
0x03600003  0 2112 ...

Any value in the third column, which is greater than the width of the left monitor (here 1920) is a window on the right monitor

From here I can go with awk:

wmctrl -l -G | awk '$3 > 1920'

If the output is not empty, there is at least one window on the right monitor

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .