polybar / polybar-scripts

This is a community project. We write and collect scripts for polybar!
The Unlicense
2.48k stars 340 forks source link

Added support for multi monitor setups to herbstluftwm workspace info #321

Closed fanginoort closed 3 years ago

fanginoort commented 3 years ago

This adds support for using the info-hlwm-workspaces.sh script on a multi monitor setup.

It expects MONITOR environment variable to be set for each instance of polybar. If the MONITOR variable is not set this will still be working, however there will be no distinction between the different monitors. This enables formatting the tags considering whether the current monitor is focused or not.

Also if one clicks on one of the tags in polybar, the script will ensure that the monitor is focused where the user clicked the tag. This prevents the effect that if one clicks a tag on an unfocused monitor, the tag will change on the other, focused monitor. This is eventually unexpected behaviour.

patrick96 commented 3 years ago

Seems x70b1 was slightly faster :wink:

fanginoort commented 3 years ago

I tried to change as little as possible, which however wasn't the smartest thing after all. The new commit now includes one case for each state prefix with the comments coming right from herbstluftwm's documentation :)

x70b1 commented 3 years ago

Thanks @fanginoort !