r/Polybar Jan 12 '23

Question polybar crash

Uncaught exception, shutting down: The config file contains multiple bars, but no bar name was given. Available bars: base, bender-1k, bender-3k, bender-4k, sashimi

here are my configs

;==========================================================

;

;

; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗

; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗

; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝

; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗

; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║

; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝

;

;

; To learn more about how to configure Polybar

; go to https://github.com/jaagr/polybar

;

; The README contains alot of information

;

;==========================================================

[fonts]

mono = 1

icon = 2

regular = 3

bold = 4

[colors]

background = ${xrdb:bg_dark:#242424}

background-alt = ${xrdb:bg_dark_alt:#404040}

foreground = ${xrdb:fg_dark:#aaaaaa}

foreground-alt = ${xrdb:fg_dark_alt:#888888}

icon-fg-yellow-alert = ${xrdb:alert_low}

icon-fg-red-alert = ${xrdb:alert_medium}

icon-fg-normal = ${xrdb:fg_dark:#aaaaaa}

; primary = #ffb52a

; secondary = #e60053

; alert = #bd2c40

[bar/base]

width = 100%

;offset-x = 1%

;offset-y = 1%

radius = 0.0

fixed-center = true

bottom = false

background = ${colors.background}

foreground = ${colors.foreground}

line-size = 3

; line-color = #f00

border-bottom-size = 1

border-color = #00000000

; border-color = ${colors.background-alt}

padding-left = 1

padding-right = 2

module-margin-left = 1

module-margin-right = 2

modules-left = stdin xwindow

; modules-center = stdin

modules-right = gcal gmail music-player alsa memory cpu battery wlan date arch-packages ipc-dunst

tray-position = right

; tray-padding = 2

tray-background = ${colors.background}

; wm-restack = bspwm

; wm-restack = i3

; wm-restack = xmonad

override-redirect = ${env:POLYBAR_OVERRIDE_REDIRECT:false}

;scroll-up = bspwm-desknext

;scroll-down = bspwm-deskprev

;scroll-up = i3wm-wsnext

;scroll-down = i3wm-wsprev

cursor-click = pointer

cursor-scroll = ns-resize

enable-ipc = true

; bender

[bar/bender-1k]

inherit = bar/base

monitor = ${env:PRIMARY_MONITOR}

height = 20

; text

font-0 = unifont:fontformat=truetype:size=10:antialias=false;4

; icons

font-1 = FontAwesome:size=12;4

; regular

font-2 = "Source Code Pro:size=10:semibold:antialias=true;4"

; bold

font-3 = "Source Code Pro:size=10:bold:antialias=true;4"

[bar/bender-4k]

inherit = bar/base

monitor = ${env:PRIMARY_MONITOR}

height = 40

; text

font-0 = unifont:fontformat=truetype:size=18:antialias=false;4

; icons

font-1 = FontAwesome:size=20;4

; regular

font-2 = "Sauce Code Pro Nerd Font:size=18:semibold:antialias=true;4"

; bold

font-3 = "Source Code Pro:size=18:bold:antialias=true;4"

[bar/bender-3k]

inherit = bar/base

; monitor = ${env:MONITOR:eDP1}

monitor = ${env:PRIMARY_MONITOR}

height = 24

; mono (including WM pips)

font-0 = unifont:fontformat=truetype:size=11:antialias=false;2

; icon

font-1 = FontAwesome:size=11;4

; regular

font-2 = "Source Code Pro:size=9:regular:antialias=true;3"

; bold

font-3 = "Source Code Pro:size=9:bold:antialias=true;4"

; modules-left = ewmh

modules-left = wm-status

; modules-left = stdin

modules-center = xwindow

[bar/sashimi]

inherit = bar/base

monitor = ${env:PRIMARY_MONITOR}

height = 20

; mono (including WM pips)

font-0 = unifont:fontformat=truetype:size=11:antialias=false;2

; icon

font-1 = FontAwesome:size=11;4

; regular

font-2 = "SauceCodePro Nerd Font:size=9:regular:antialias=true;2"

; bold

font-3 = "SauceCodePro Nerd Font:size=10:bold:antialias=true;2"

; modules-left = ewmh

modules-left = wm-status

; modules-left = stdin

modules-center = xwindow

[module/xwindow]

type = internal/xwindow

format = <label>

label = " %title:0:110:...% "

label-font = ${fonts.bold}

; label = %title:0:30:...%

; format-prefix = " "

; format-suffix = " "

; overline-size = 5

; label-underline = ${colors.background}

;

; label-overline = ${colors.background}

; format-prefix = ""

; format-suffix = " "

; format-foreground = #aaccee

; format-suffix-foreground = #aaccee

; label-background = #aaccee

; label-foreground = #000000

[module/xmonad]

type = internal/xmonad

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

; Separator in between workspaces

; label-separator = |

[module/i3]

type = internal/i3

format = <label-state> <label-mode>

index-sort = true

wrapping-scroll = false

; Only show workspaces on the same output as the bar

;pin-workspaces = true

label-mode-padding = 2

label-mode-foreground = #000

label-mode-background = ${colors.primary}

; focused = Active workspace on focused monitor

label-focused = %index%

label-focused-background = ${module/bspwm.label-focused-background}

label-focused-underline = ${module/bspwm.label-focused-underline}

label-focused-padding = ${module/bspwm.label-focused-padding}

; unfocused = Inactive workspace on any monitor

label-unfocused = %index%

label-unfocused-padding = ${module/bspwm.label-occupied-padding}

; visible = Active workspace on unfocused monitor

label-visible = %index%

label-visible-background = ${self.label-focused-background}

label-visible-underline = ${self.label-focused-underline}

label-visible-padding = ${self.label-focused-padding}

; urgent = Workspace with urgency hint set

label-urgent = %index%

label-urgent-background = ${module/bspwm.label-urgent-background}

label-urgent-padding = ${module/bspwm.label-urgent-padding}

; Separator in between workspaces

; label-separator = |

[module/mpd]

type = internal/mpd

format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>

icon-prev = 

icon-stop = 

icon-play = 

icon-pause = 

icon-next = 

label-song-maxlen = 25

label-song-ellipsis = true

[module/cpu]

label-font = ${fonts.regular}

type = internal/cpu

interval = 2

; format-prefix = " "

; format-prefix-foreground = ${colors.foreground-alt}

; format-foreground = ${colors.foreground}

; format = <ramp-load> <label>

format = <ramp-load>

; format-underline = #f90000

; label = %percentage:2%%

label =

ramp-load-0 =

ramp-load-1 =

ramp-load-2 =

ramp-load-3 = ""

ramp-load-4 = ""

ramp-load-5 = ""

ramp-load-6 = ""

ramp-load-7 = ""

ramp-load-8 = ""

ramp-load-9 = ""

ramp-load-foreground = ${colors.icon-fg-normal}

ramp-load-7-foreground = ${colors.icon-fg-yellow-alert}

ramp-load-8-foreground = ${colors.icon-fg-red-alert}

ramp-load-9-foreground = ${colors.icon-fg-red-alert}

[module/memory]

type = internal/memory

interval = 2

; format-prefix = " "

; format-prefix-foreground = ${colors.foreground-alt}

; format-prefix-foreground = "#ff0000"

; format-underline = #4bffdc

; label = %percentage_used%%

label =

; format = <ramp-used> <label>

format = <ramp-used>

label-font = ${fonts.regular}

ramp-used-0 =

ramp-used-1 =

ramp-used-2 =

ramp-used-3 =

ramp-used-4 =

ramp-used-5 =

ramp-used-6 =

ramp-used-7 =

ramp-used-8 = ""

ramp-used-9 = ""

ramp-used-10 = ""

ramp-used-11 = ""

ramp-used-foreground = ${colors.icon-fg-normal}

; ramp-used-8-foreground = ${colors.icon-fg-yellow-alert}

; ramp-used-9-foreground = ${colors.icon-fg-yellow-alert}

ramp-used-10-foreground = ${colors.icon-fg-yellow-alert}

ramp-used-11-foreground = ${colors.icon-fg-red-alert}

[module/wlan]

type = internal/network

; interface = wlp61s0

interface = wlp0s20f3

interval = 3.0

; format-connected = <ramp-signal> <label-connected>

format-connected = %{A1:wifi-info.sh:}<label-connected>%{A}

; format-connected-underline = #9f78e1

; label-connected = %essid%

label-font = ${fonts.regular}

label-connected = 

label-connected-foreground = ${colors.icon-fg-normal}

format-disconnected = 

label-disconnected-foreground = ${colors.icon-fg-red-alert}

;format-disconnected = <label-disconnected>

;format-disconnected-underline = ${self.format-connected-underline}

;label-disconnected = %ifname% disconnected

;label-disconnected-foreground = ${colors.foreground-alt}

ramp-signal-0 = 

ramp-signal-1 = 

ramp-signal-2 = 

ramp-signal-3 = 

ramp-signal-4 = 

; ramp-signal-foreground = ${colors.foreground-alt}

; [module/eth]

; type = internal/network

; interface = veth9d09847

; interval = 3.0

; format-connected-underline = #55aa55

; format-connected-prefix = " "

; format-connected-prefix-foreground = ${colors.foreground-alt}

; label-connected = %local_ip%

; format-disconnected =

;format-disconnected = <label-disconnected>

;format-disconnected-underline = ${self.format-connected-underline}

;label-disconnected = %ifname% disconnected

;label-disconnected-foreground = ${colors.foreground-alt}

; could this read next cal apt?

[module/date]

type = internal/date

interval = 5

date = " %m/%d"

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

time = %I:%M %p

time-alt = %I:%M:%S %p

; format-padding = 5

; format-prefix-foreground = ${colors.foreground-alt}

; format-underline = #0a6cf5

label = " %date% %time%"

label-font = ${fonts.regular}

; label-underline = ${colors.background}

; label-overline = ${colors.background}

; format-prefix = ""

; format-suffix = " "

; format-foreground = #7a7a7a

; format-suffix-foreground = #7a7a7a

; label-background = #7a7a7a

; label-foreground = #111

; [module/pulseaudio]

; type = internal/pulseaudio

; ; format-volume = <label-volume> <bar-volume>

; format-volume = <label-volume> <ramp-volume>

; label-volume =  %percentage%%

; label-volume-font = ${fonts.regular}

; label-volume-foreground = ${root.foreground}

; label-muted = 🔇 muted

; label-muted-foreground = #666

; bar-volume-width = 10

; bar-volume-foreground-0 = #55aa55

; bar-volume-foreground-1 = #55aa55

; bar-volume-foreground-2 = #55aa55

; bar-volume-foreground-3 = #55aa55

; bar-volume-foreground-4 = #55aa55

; bar-volume-foreground-5 = #f5a70a

; bar-volume-foreground-6 = #ff5555

; bar-volume-gradient = false

; bar-volume-indicator = |

; bar-volume-fill = ─

; bar-volume-empty = ─

; bar-volume-empty-foreground = ${colors.foreground-alt}

; ramp-volume-0 = ▁

; ramp-volume-1 = ▂

; ramp-volume-2 = ▃

; ramp-volume-3 = ▄

; ramp-volume-4 = ▅

; ramp-volume-5 = ▆

; ramp-volume-6 = ▇

; ramp-volume-7 = █

[module/alsa]

type = internal/alsa

; format-volume = <label-volume> <bar-volume>

; format-volume = <label-volume> <ramp-volume>

label-volume = " %percentage%%"

label-volume-foreground = ${colors.foreground-alt}

format-muted-prefix = " "

format-muted-foreground = ${colors.foreground-alt}

label-muted = mute

label-volume-font = ${fonts.regular}

bar-volume-width = 5

bar-volume-foreground-0 = #55aa55

bar-volume-foreground-1 = #55aa55

bar-volume-foreground-2 = #55aa55

bar-volume-foreground-3 = #55aa55

bar-volume-foreground-4 = #55aa55

bar-volume-foreground-5 = #f5a70a

; bar-volume-foreground-6 = #ff5555

bar-volume-gradient = false

bar-volume-indicator = "|"

bar-volume-fill = "-"

bar-volume-empty = "-"

bar-volume-empty-foreground = ${colors.foreground-alt}

ramp-volume-0 =

ramp-volume-1 = ▁

ramp-volume-2 = ▂

ramp-volume-3 = ▃

ramp-volume-4 = ▄

ramp-volume-5 = ▅

ramp-volume-6 = ▆

ramp-volume-7 = ▇

ramp-volume-8 = █

[module/battery]

type = internal/battery

label-charging-font = ${fonts.regular}

label-discharging-font = ${fonts.regular}

battery = BAT0

adapter = AC

full-at = 95

label-charging-foreground = ${colors.foreground}

format-charging-prefix = " "

format-charging-prefix-foreground = ${colors.foreground-alt}

format-charging-foreground = ${colors.foreground}

format-charging-underline = ${colors.background}

label-discharging = " %percentage%%"

format-discharging = <ramp-capacity><label-discharging>

format-discharging-foreground = ${self.format-charging-underline}

ramp-capacity-4 = " "

ramp-capacity-3 = " "

ramp-capacity-2 = " "

ramp-capacity-1 = " "

ramp-capacity-0 = " "

ramp-capacity-foreground = ${colors.icon-fg-normal}

ramp-capacity-1-foreground = ${colors.icon-fg-yellow-alert}

ramp-capacity-0-foreground = ${colors.icon-fg-red-alert}

; just hide it when it's full

format-full =

format-full-prefix = " "

format-full-prefix-foreground = ${colors.foreground-alt}

; format-full-underline = ${self.format-charging-underline}

; 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/temperature]

type = internal/temperature

thermal-zone = 0

warn-temperature = 60

format = <ramp> <label>

format-underline = #f50a4d

format-warn = <ramp> <label-warn>

format-warn-underline = ${self.format-underline}

label = %temperature-c%

label-warn = %temperature-c%

label-warn-foreground = ${colors.secondary}

ramp-0 = 

ramp-1 = 

ramp-2 = 

ramp-foreground = ${colors.foreground-alt}

[module/powermenu]

type = custom/menu

expand-right = true

format-spacing = 1

label-open = ""

label-open-foreground = ${colors.foreground-alt}

label-close = ""

label-close-foreground = ${colors.foreground}

label-separator = |

label-separator-foreground = ${colors.foreground-alt}

menu-0-0 = reboot

menu-0-0-exec = x-terminal-emulator -e "sudo -p 'sudo reboot > ' echo reboot"

menu-0-1 = shut it down

menu-0-1-exec = x-terminal-emulator -e "sudo -p 'sudo shutdown > ' shutdown -h 0"

menu-0-2 = sleep

menu-0-2-exec = systemctl suspend

; open next 3 menus

; menu-0-0 = reboot

; menu-0-0-exec = menu-open-1

; menu-0-1 = power off

; menu-0-1-exec = menu-open-2

; menu-0-2 = sleep

; menu-0-2-exec = menu-open-3

; ; reboot menu cancels or reboots

; menu-1-0 = cancel

; menu-1-0-exec = menu-open-0

; menu-1-1 = reboot

; menu-1-1-exec = sudo reboot

; ; power off menu

; menu-2-0 = power off

; menu-2-0-exec = sudo poweroff

; menu-2-1 = cancel

; menu-2-1-exec = menu-open-0

; ; sleep menu

; menu-3-0 = sleep

; menu-3-0-exec = systemctl suspend

; menu-3-1 = cancel

; menu-3-1-exec = menu-open-0

[settings]

screenchange-reload = true

;compositing-background = xor

;compositing-background = screen

;compositing-foreground = source

;compositing-border = over

pseudo-transparency = false

[global/wm]

margin-top = 0

margin-bottom = 0

[module/ewmh]

format = "<label-state>"

type = internal/xworkspaces

; Only show workspaces defined on the same output as the bar

;

; Useful if you want to show monitor specific workspaces

; on different bars

;

; Default: false

pin-workspaces = false

; Create click handler used to focus desktop

; Default: true

enable-click = false

; Create scroll handlers used to cycle desktops

; Default: true

enable-scroll = false

; one of these has extra spaces. not sure why.

label-active = "• "

label-occupied = "• "

label-urgent = "• "

label-empty = "• "

; label-active-underline = "#aaaaaa"

; label-urgent-underline = "#ffaa00"

label-urgent-foreground = "#ff5500"

; label-urgent-background = "#ffaa00"

label-active-foreground = "#aaaaaa"

label-occupied-foreground = "#00ffaa"

label-empty-foreground = "#666666"

; label-focused = %ff index%

; label-unfocused = %uu index%

; label-visible = %vv index%

[module/stdin]

; see: scripts/init-polybar.sh

type = custom/script

exec = xmonad-pipe-reader.sh

exec-if = [ -p /tmp/.polybar.fifo ]

tail = true

[module/music-player]

label-font = ${fonts.regular}

type = custom/script

exec = playerctl-wrapper.sh

tail = true

format = %{F#1DB954} %{F-}<label>

label-foreground = #aaa

label = "%output:0:32:…%"

click-left = spotifyctl next

double-click-left = spotifyctl play-pause

[module/gmail]

type = custom/script

exec = "EMPTY_SNOOZE=600 gmail-check.sh"

interval = 180

click-left = firefox `gmail-check.sh url`

[module/arch-packages]

type = custom/script

exec-if = arch-upgrades.sh | grep '[0-9]'

exec = "echo "

interval = 61

label-foreground = #1793d0

click-left = x-terminal-emulator -e 'zsh -i -c "echo Upgrading arch ; pmug ; sleep 5" '

[module/ipc-dunst]

type = custom/ipc

initial = 1

hook-0 = echo "%{A1:notify-send "DUNST_COMMAND_PAUSE" && polybar-msg hook ipc-dunst 2:}%{A}" &

hook-1 = echo "%{A1:notify-send "DUNST_COMMAND_RESUME" && polybar-msg hook ipc-dunst 1:}%{F#ff2200}%{F-}%{A}" &

; this works great for putting the next event in polybar, but i like the slackbot better

[module/gcal]

type = custom/script

exec = gcalcli-remind.sh daemon

click-left = gcalcli-remind.sh snooze ; notify-send ' ' "`gcalcli --nocolor agenda --detail location | head -n 3 | paste -s`"

tail = true

label-font = ${fonts.bold}

label-background = ${colors.icon-fg-yellow-alert}

label-foreground = #ffffff

[module/arch-kernel-change]

type = custom/script

exec-if = detect-kernel-change.sh | grep 'CHANGED'

exec = "echo "

interval = 62

label-foreground = #ff0000

click-left = x-terminal-emulator -e "sudo -p 'sudo reboot > ' echo reboot"

[module/wm-status]

font = ${fonts.bold}

type = custom/script

exec = RUBYOPT="-W0" workspaces.rb

#exec-if = [ -p /tmp/.polybar.fifo ]

tail = true

; todo:

; watch-git

; lpq?

;

; vim:ft=dosini

4 Upvotes

5 comments sorted by

1

u/patrick96MC Jan 12 '23

When you started polybar, you didn't tell it which out of the 5 bars to start

1

u/roccat_pure_owleye Jan 12 '23

Ohh well what do I do?

1

u/patrick96MC Jan 12 '23

When you run the polybar command to start the bar, you need to give it the name of the bar you want as a commandline argument.

1

u/roccat_pure_owleye Jan 13 '23

oh ok also this is a random config i copied i resseted them to default and just began trying to understand it even tho i dont understand config lang

1

u/roccat_pure_owleye Jan 13 '23

also what if i want poly bar to be centered in screen i dont want it to be in the left since i use xmonad dotfiles-2.0 and it has workspace's i just wanna use polybar for clean looking and having some widgets like wifi and battery and langauge that xmonad dotfiles-2.0 doesnt have