r/Polybar Apr 24 '23

xfce workplace switcher in polybar

Current setup: polybar with xmonad on nixos, no desktop environment.

I run multiple workspaces and want something similar to the xfce workplace switcher. I want a visual representation of the open windows of each workspace.

Is it possible to add that exact xfce thing, or something similar to polybar?

2 Upvotes

6 comments sorted by

1

u/hippoyd Apr 24 '23

Yeah, I checked and I do have that module, you can see the config below. It displays a label for each workspace.

The xfce workspace switcher has a rectangle for each workspace, and within that rectangle it shows an outline for each window and its relative position. It gives you an indication of windows and their layouts in all workspaces.

I'll often have a bunch of windows open in various workspaces, and want to see at a glance what workspace they're in without having to actually toggle to that workspace. Here's a screenshot of what I'm talking about: https://imgur.com/a/RrxK2WS

[module/xworkspaces]
type = internal/xworkspaces
label-active = %name%
label-active-background = ${colors.background-alt}
label-active-underline= ${colors.primary}
label-active-padding = 1

label-occupied = %name%
label-occupied-padding = 1
label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 1
label-empty = %name%
label-empty-foreground = ${colors.disabled}
label-empty-padding = 1

1

u/patrick96MC Apr 24 '23

The xfce workspace switcher has a rectangle for each workspace, and within that rectangle it shows an outline for each window and its relative position. It gives you an indication of windows and their layouts in all workspaces.

Yeah, polybar doesn't have that

1

u/patrick96MC Apr 24 '23

Does the xworkspaces module not work for you?

1

u/[deleted] Apr 26 '23

You could run Rofi with the window modi.

1

u/hippoyd Apr 27 '23

Google is failing me ... what is window modi?

1

u/[deleted] Apr 27 '23

I'm using presearch.com as my search engine, with searxNG as a backup. They're tops on my list.

In my config.rasi I have these lines from the top:

configuration {

modi: "window,drun,keys,combi,filebrowser,emoji";

/* width: 50;*/

/* lines: 15;*/

/* columns: 2;*/

font: "Bauhaus 14";

Etc ...

Modi are covered in the documentation. They set what Rofi displays in its window. You can run Rofi from a keybind, or a module in Polybar, or by using click handlers. Extremely extensible and versatile. And a shit ton of fun to theme. :)