This fork outputs the window names on the visible workspace per monitor - e.g monitor 1 will always display the titles of windows on the workspace currently visible on that monitor, even if the focused workspace is one on another monitor. It also orders the window titles to mimick the actual window layout left-to-right (tiebroken by top-to-bottom).
A Polybar script forked from polybar-windows with additional features. (Requires EWMH-compliancy)
- Left click: Focus window and raise it if it is minimized. If the window is already focused, minimize it.
- Middle click: Close the window.
- Right click: Select a rectangle for the window to be re-positioned to.
- Mouse wheel: Resize the window incrementally.
For a very limited multihead implementation, check out the multihead branch.
The following variables at the top of the file may be customized:
Setting | Description |
---|---|
active_text_color="#250F0B" |
Color of the name of the active window. |
active_bg= |
Background colour of active window. Leave empty if unwanted. |
active_underline="#ECB3B2" |
Underline colour of active window. Leave empty if unwanted. |
inactive_text_color="#250F0B" |
Color of the name of inactive windows. |
inactive_bg= |
Background colour of inactive windows. Leave empty if unwanted. |
inactive_underline= |
Underline colour of inactive windows. Leave empty if unwanted. |
separator="·" |
String displayed between window names. |
show="window_class" |
Whether to display window_title, window_class or window_classname. |
forbidden_classes="Polybar Conky Gmrun" |
Window classes that you do not wish to appear in the window list. |
empty_desktop_message="Desktop" |
String to display if no window is open. |
case="normal" |
normal, upper, lower. |
char_limit=20 |
Maximum window name length after which it will be truncated. |
max_windows=15 |
Maximum number of displayed windows. Useful if you have limited space. Will show how many windows are hidden. (e.g. +3 ) |
add_spaces="true" |
Whether to add a space to the side of each window name. |
resize_increment=16 |
Size in pixel of resizing steps for the mouse wheel functions. |
wm_border_width=1 |
Setting this variable might make resizing positions more accurate. |
- Install
wmctrl
, it should be packaged by most distros. For example on Ubuntu and Debian-based distros,sudo apt install wmctrl
- Save
polywins.sh
, for example to~/.config/polybar/scripts
- Make the script executable with
chmod +x ~/.config/polybar/scripts/polywins.sh
- Change any setting you wish at the top of the script
- Ensure you are launching polybar with the current monitor name set as the MONITOR environment variable. For example:
#!/bin/bash
killall -q polybar &
wait
if type "xrandr"; then
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
echo $m
MONITOR=$m polybar --reload example &
done
else
polybar --reload example &
fi
- Add the following module to your polybar config:
[module/polywins]
type = custom/script
exec = ~/.config/polybar/scripts/polywins.sh $MONITOR 2>/dev/null
format = <label>
label = %output%
label-padding = 1
tail = true
- Add the module to one of your bars, and don't forget to set a line-size if you intend to use underline, for example like so:
[bar/your_bar_name]
modules-center = polywins
line-size = 2
xprop
wmctrl
slop
for rectangle-resizing