You are not logged in.

#1 2021-12-27 12:36:19

WeebSpirit
Member
Registered: 2021-10-27
Posts: 91

[SOLVED] Problems configuring workspaces in polybar. [bspwm]

I want it to show workspaces as web(1 workspace), term(2 workspace) and so on. I followed the wiki on polybar's github page. https://github.com/polybar/polybar/wiki/Module:-bspwm
I tried the script on the bottom of it. which resulted in:
ws-icon-0 = "1;<insert-icon-here>"
ws-icon-1 = "2;<insert-icon-here>"
ws-icon-2 = "3;<insert-icon-here>"
ws-icon-3 = "4;<insert-icon-here>"
ws-icon-4 = "5;<insert-icon-here>"
ws-icon-5 = "6;<insert-icon-here>"
ws-icon-6 = "7;<insert-icon-here>"
ws-icon-7 = "8;<insert-icon-here>"
ws-icon-8 = "9;<insert-icon-here>"
ws-icon-9 = "10;<insert-icon-here>"

My config file:
ws-icon-0 = "1;web"
ws-icon-1 = "2;term"
ws-icon-2 = "3;mail"
ws-icon-3 = "4;mus"
ws-icon-4 = "5;etc"
ws-icon-5 = "6;6"
ws-icon-6 = "7;7"
ws-icon-7 = "8;8"
ws-icon-8 = "9;9"
ws-icon-9 = "10;10"
What am i doing wrong and how to properly define it?

Last edited by WeebSpirit (2021-12-31 18:33:18)

Offline

#2 2021-12-28 09:23:37

WeebSpirit
Member
Registered: 2021-10-27
Posts: 91

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

I've tried so many different methods. None works, i tried defining them as I II etc, but it still doesn't work, i tried using "" and without them but it still not showing it how i want

Offline

#3 2021-12-28 19:35:43

WeebSpirit
Member
Registered: 2021-10-27
Posts: 91

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

At this point i don't even know what to do. I've tried everything

Offline

#4 2021-12-29 14:34:25

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

Instead of bumping you should provide more detailed information what you actually tried and what your expectations and the results were.

Begin with how you installed polybar.
From what I see, you shoud insert an icon instead of a word where <insert-icon-here> occurs. Did you install siji-git?

Offline

#5 2021-12-29 22:35:08

WeebSpirit
Member
Registered: 2021-10-27
Posts: 91

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

i did install siji-git, polybar was installed from aur. polybar-git package. Icon can be replaced with whatever u want it to dipslay afaik

Offline

#6 2021-12-30 11:06:41

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

What is displayed needs to be defined in bspwm's config file, usually .config/bspwm/bspwmrc, not in polybar's.

e.g.

bspc monitor -d Term geeqie fotoxx Browser V emacs mpv VIII IX X

Last edited by Stefan Husmann (2021-12-30 11:08:15)

Offline

#7 2021-12-30 14:22:28

WeebSpirit
Member
Registered: 2021-10-27
Posts: 91

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

You're wrong, when changing in bspwmrc, it changes how it should be defined, so its not "1;icon" but "web;icon"

Offline

#8 2021-12-30 14:24:04

WeebSpirit
Member
Registered: 2021-10-27
Posts: 91

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

This can be checked by executing the shell script on the bottom of poybar's wiki, bspwm module

Offline

#9 2021-12-30 15:59:44

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

This works for me  in the section [module/bspwm] of polybar's config.ini file.

fuzzy-match = true
ws-icon-0 = Term;♚
ws-icon-1 = geeqie;♛
ws-icon-2 = fotoxx;♜
ws-icon-3 = Browser;♝
ws-icon-4 = emacs;♞
ws-icon-default = ♟

Offline

#10 2021-12-30 18:13:13

WeebSpirit
Member
Registered: 2021-10-27
Posts: 91

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

Still i have 1 2 3 but not icons, it doesn't say anything about unmatched characters

Offline

#11 2021-12-30 18:17:27

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

Please share your bspwm-config.

Offline

#12 2021-12-30 18:29:16

WeebSpirit
Member
Registered: 2021-10-27
Posts: 91

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

I copied from you #!/bin/zsh

pgrep -x sxhkd > /dev/null || sxhkd &

bspc monitor -d Term geeqie fotoxx Browser V emacs mpv VIII IX X

bspc config normal_border_color  "#4b565c"
bspc config focused_border_color "#a7c080"
bspc config border_width         2
bspc config window_gap           11
bspc config split_ratio          0.52
bspc config borderless_monocle   true
bspc config gapless_monocle      true

bspc rule -a Gimp desktop='^8' state=floating
bspc rule -a Zathura state=tiled
bspc rule -a Transmission desktop='^10' follow=on
bspc rule -a transmission-gtk desktop='^10' follow=on

And then polybar:
ws-icon-0 = Term;♚
ws-icon-1 = geeqie;♛
ws-icon-2 = fotoxx;♜
ws-icon-3 = Browser;♝
ws-icon-4 = V;a
ws-icon-5 = emacs;♞
ws-icon-default = ♟

Offline

#13 2021-12-30 18:59:56

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

Please use code tags for posting file contents or command line input here.

My example was an example, and pasting it into your config file as is makes no sense unless you want to run geeqie, fotoxx, emacs or mpv on your desktop.

Please post the complete polybar config. As written above the ws-icon stuff mus be written into the  [module/bspwm]  section.

Offline

#14 2021-12-30 21:44:59

WeebSpirit
Member
Registered: 2021-10-27
Posts: 91

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

bspwm:

#!/bin/zsh

pgrep -x sxhkd > /dev/null || sxhkd &

bspc monitor -d 1 2 3 4 5 6 7 8 9 10

bspc config normal_border_color  "#4b565c"
bspc config focused_border_color "#a7c080"
bspc config border_width         2
bspc config window_gap           11
bspc config split_ratio          0.52
bspc config borderless_monocle   true
bspc config gapless_monocle      true

bspc rule -a Gimp desktop='^8' state=floating
bspc rule -a Zathura state=tiled
bspc rule -a Transmission desktop='^10' follow=on
bspc rule -a transmission-gtk desktop='^10' follow=on

polybar:

[colors] 
background = #2b3339
background-alt = #4b565c
foreground = #d3c6aa
foreground-alt = #d3c6aa
primary = #a7c080
secondary = #d3c6aa
alert = #e67e80

[bar/workspaces]
;monitor = ${env:MONITOR:HDMI-1}
width = 30%
height = 29
; offset-x = 1%
; offset-y = 1%
radius = 11
fixed-center = false

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 3
line-color = #a7c080

border-size = 6
border-color = #00000000

padding-left = 0
padding-right = 0

module-margin-left = 1
module-margin-right = 2

font-0 = CaskaydiaCove Nerd Font:pixelsize=11;1

modules-left = bspwm
modules-center = 
modules-right = 

wm-restack = bspwm
;wm-restack = i3

;override-redirect = true

scroll-up = bspwm-desknext
scroll-down = bspwm-deskprev

;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev

cursor-click = pointer
cursor-scroll = normal

[module/bspwm]
type = internal/bspwm

label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2

label-occupied = %index%
label-occupied-padding = 2

label-urgent = %index%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 2

label-empty = %index%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2

pin-workspaces = true

ws-icon-0 = "1;web"
ws-icon-1 = "2;term"
ws-icon-2 = "3;mail"
ws-icon-3 = "4;mus"
ws-icon-4 = "5;etc"
ws-icon-5 = "6;6"
ws-icon-6 = "7;7"
ws-icon-7 = "8;8"
ws-icon-8 = "9;9"
ws-icon-9 = "10;10"
; Separator in between workspaces
; label-separator = |

[bar/time]

;monitor = ${env:MONITOR:HDMI-1}
width = 5%
height = 29
offset-x = 49.5%
; offset-y = 1%
radius = 11
fixed-center = false

background = ${colors.background}
foreground = ${colors.foreground}

border-size = 6
border-color = #00000000

padding-left = 0
padding-right = 0

module-margin-left = 1
module-margin-right = 2

font-0 = CaskaydiaCove Nerd Font:pixelsize=11;1

modules-left = 
modules-center = time
modules-right = 

wm-restack = bspwm
;wm-restack = i3

;override-redirect = true

scroll-up = bspwm-desknext
scroll-down = bspwm-deskprev

;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev

cursor-click = pointer
cursor-scroll = normal

[module/time]
type = internal/date
interval = 5

date =
date-alt = "%Y-%d-%m"

time = %H:%M
time-alt = %H:%M:%S

format-prefix =  
format-prefix-foreground = ${colors.foreground}
format-underline = #a7c080

label = %date% %time%

[bar/other]

;monitor = ${env:MONITOR:HDMI-1}
width = 20%
height = 29
offset-x = 80%
; offset-y = 1%
radius = 11
fixed-center = false

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 3
line-color = #a7c080

border-size = 6
border-color = #00000000

padding-left = 0
padding-right = 0

module-margin-left = 1
module-margin-right = 2

font-0 = CaskaydiaCove Nerd Font:pixelsize=11;1

modules-left = 
modules-center = pulseaudio battery
modules-right = 

wm-restack = bspwm
;wm-restack = i3

;override-redirect = true

scroll-up = bspwm-desknext
scroll-down = bspwm-deskprev

;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev

cursor-click = pointer
cursor-scroll = normal

tray-position = right
tray-padding = 2
tray-background = #2b3339

[module/pulseaudio]
type = internal/pulseaudio

format-volume = <label-volume>
label-volume = 墳 %percentage%%
label-volume-foreground = ${root.foreground}

label-muted = ? muted
label-muted-foreground = #d3c6aa

bar-volume-width = 8
ar-volume-indicator-font = 2
bar-volume-fill-font = 2
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}

format-charging = <animation-charging> <label-charging>
format-charging-underline = #ffb52a

format-discharging = <animation-discharging> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}

format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${self.format-charging-underline}

ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-foreground = ${colors.foreground-alt}

animation-charging-0 = 
animation-charging-1 = 
animation-charging-2 = 
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 750

animation-discharging-0 = 
animation-discharging-1 = 
animation-discharging-2 = 
animation-discharging-foreground = ${colors.foreground-alt}
animation-discharging-framerate = 750

[module/battery]
type = internal/battery

; This is useful in case the battery never reports 100% charge
full-at = 100

; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
battery = BAT1
adapter = ACAD

; If an inotify event haven't been reported in this many
; seconds, manually poll for new values.
;
; Needed as a fallback for systems that don't report events
; on sysfs/procfs.
;
; Disable polling by setting the interval to 0.
;
; Default: 5
poll-interval = 5

; see "man date" for details on how to format the time string
; NOTE: if you want to use syntax tags here you need to use %%{...}
; Default: %H:%M:%S
time-format = %H:%M

; Available tags:
;   <label-charging> (default)
;   <bar-capacity>
;   <ramp-capacity>
;   <animation-charging>
format-charging = <animation-charging> <label-charging>

; Available tags:
;   <label-discharging> (default)
;   <bar-capacity>
;   <ramp-capacity>
;   <animation-discharging>
format-discharging = <ramp-capacity> <label-discharging>

; Available tags:
;   <label-full> (default)
;   <bar-capacity>
;   <ramp-capacity>
;format-full = <ramp-capacity> <label-full>

; Available tokens:
;   %percentage% (default) - is set to 100 if full-at is reached
;   %percentage_raw%
;   %time%
;   %consumption% (shows current charge rate in watts)
label-charging = Charging %percentage%%

; Available tokens:
;   %percentage% (default) - is set to 100 if full-at is reached
;   %percentage_raw%
;   %time%
;   %consumption% (shows current discharge rate in watts)
label-discharging = Discharging %percentage%%
; Available tokens:
;   %percentage% (default) - is set to 100 if full-at is reached
;   %percentage_raw%
label-full = 100%  

; Only applies if <ramp-capacity> is used
ramp-capacity-0 =   
ramp-capacity-1 =   
ramp-capacity-2 =   
ramp-capacity-3 =   
ramp-capacity-4 =   

; Only applies if <bar-capacity> is used
bar-capacity-width = 10

; Only applies if <animation-charging> is used
animation-charging-0 =  
animation-charging-1 =  
animation-charging-2 =  
animation-charging-3 =  
animation-charging-4 =  
; Framerate in milliseconds
animation-charging-framerate = 600

; Only applies if <animation-discharging> is used
animation-discharging-0 =  
animation-discharging-1 =  
animation-discharging-2 =  
animation-discharging-3 =  
animation-discharging-4 =  
; Framerate in milliseconds
animation-discharging-framerate = 600
; vim:ft=dosini

[global/wm]
margin-top = -5
magin-bottom = 0

Last edited by WeebSpirit (2021-12-31 10:48:19)

Offline

#15 2021-12-30 22:41:13

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

as written before, put [module/bspwm] in front of the ws-icon -tuff

[module/bspwm]
ws-icon-0 = "1;web"
ws-icon-1 = "2;term"
ws-icon-2 = "3;mail"
ws-icon-3 = "4;mus"
ws-icon-4 = "5;etc"
ws-icon-5 = "6;6"
ws-icon-6 = "7;7"
ws-icon-7 = "8;8"
ws-icon-8 = "9;9"
ws-icon-9 = "10;10"

Offline

#16 2021-12-30 23:55:02

patrickziegler
Member
From: ::1
Registered: 2018-11-02
Posts: 29
Website

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

The %index% token in the bspwm module will always show the workspace index as a number. If you want it to actually use the mapping from ws-icon-*, use the %icon% token.

Offline

#17 2021-12-30 23:58:52

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

WeebSpirit, please edit your post and use [ code ] tags (not quote tags) when posting output. This makes the output easier to read and provides a scroll box for long output.

https://wiki.archlinux.org/title/Genera … s_and_code
https://bbs.archlinux.org/help.php#bbcode

Offline

#18 2021-12-31 10:51:26

WeebSpirit
Member
Registered: 2021-10-27
Posts: 91

Re: [SOLVED] Problems configuring workspaces in polybar. [bspwm]

Thank you! I spent so much time but appears that i only needed to replace %index% with %icon%

patrickziegler wrote:

The %index% token in the bspwm module will always show the workspace index as a number. If you want it to actually use the mapping from ws-icon-*, use the %icon% token.

Offline

Board footer

Powered by FluxBB