Battery module on polybar doesn't showing at all

I have the same problem… It doesn’t work at all, shows nothing, not even a blank space


This is what polybar -r bar gave me (ignore the test module, it no longers exists)

I don’t know what can be wrong

Have you got the correct name for the battery?

ls -1 /sys/class/power_supply/

That will give you a list of available batteries and adapters and their names.

Otherwise, post your config so we can take a peek.

1 Like

Note: I can only post one image per answer.

Yeap, look

I can’t check this as I use a desktop but can you post your full config please.

Hopefully, someone here who uses a laptop can check for us.

I’m wondering if that not having poll-interval in your config maybe the issue?

poll-interval = 5

It is not, and I don’t why but looking the first image the module is not being recognized at all

##CONFIG FILE[
colors]

background = #2F2F2F

background-alt = #373B41

foreground = #C5C8C6

primary = #9884F8

secondary = #9884F8

alert = #A54242

disabled = #707880

[bar/bar]

width = 100%

height = 22pt

radius = 10

#offset-x = 5%

#offset-y = 1%

fixed-center = true

bottom = false

; dpi = 96

background = ${colors.background}

foreground = ${colors.foreground}

line-size = 2pt

border-size = 1pt

border-color = #00000000

padding-left = 10

padding-right = 10

module-margin-left = 1

module-margin-right = 1

separator = |

separator-foreground = ${colors.disabled}

font-1 = Ubuntu:style=Medium:antialias=false:size=11;1

font-0 = Font Awesome 6 Brands,Font Awesome 6 Brands Regular:style=Regular:size=10;2

#label-active-font = 2

modules-left = xworkspaces xwindow

modules-center =

modules-right = pulseaudio memory cpu test wlan date

cursor-click = pointer

cursor-scroll = ns-resize

enable-ipc = true

; tray-position = right

; wm-restack = generic

; wm-restack = bspwm

; wm-restack = i3

; override-redirect = true

[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-background = ${colors.background}

label-occupied-foreground =${colors.primary}

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

#[module/i3]

#type = internal/i3

[module/xwindow]

type = internal/xwindow

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

label-foreground = ${colors.disabled}

[module/filesystem]

type = internal/fs

interval = 25

mount-0 = /

label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%

label-unmounted = %mountpoint% not mounted

label-unmounted-foreground = ${colors.disabled}

[module/pulseaudio]

type = internal/pulseaudio

format-volume-prefix = "VOL "

format-volume-prefix-foreground = ${colors.primary}

format-volume = <label-volume>

label-volume = %percentage%%

label-muted = muted

label-muted-foreground = ${colors.disabled}

[module/xkeyboard]

type = internal/xkeyboard

blacklist-0 = num lock

label-layout = %layout%

label-layout-foreground = ${colors.primary}

label-indicator-padding = 2

label-indicator-margin = 1

label-indicator-foreground = ${colors.background}

label-indicator-background = ${colors.secondary}

[module/battery]

type = internal/battery

battery = BAT1

adapter = ACAD

full-at = 55

label-full = %percentage

format-full =  <label-full>

label-charging = %percentage%% %time%

format-charging =  <label-charging>

label-discharging = %percentage%% %time%

format-discharging = <label-discharging>

[module/memory]

type = internal/memory

interval = 2

format-prefix = "RAM "

format-prefix-foreground = ${colors.primary}

label = %percentage_used:2%%

[module/cpu]

type = internal/cpu

interval = 2

format-prefix = "CPU "

format-prefix-foreground = ${colors.primary}

label = %percentage:2%%

[network-base]

type = internal/network

interval = 5

format-connected = <label-connected>

format-disconnected = <label-disconnected>

label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected

[module/wlan]

inherit = network-base

interface-type = wireless

label-connected = %essid%

[module/eth]

inherit = network-base

interface-type = wired

label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%

[module/date]

type = internal/date

interval = 1

date = %H-%M-%S

date-alt = %Y/%m/%d %H-%M-%S

label = %date%

label-foreground = ${colors.primary}

[settings]

screenchange-reload = true

pseudo-transparency = true

; vim:ft=dosini

Pretty sure polybar needs something to measure battery usage by, wouldn’t the poll-interval be that measuring stick?

You haven’t added battery to your used modules.

That it’s, thanks!

I haven’t notice that

1 Like

Easy fix. :smiley:

1 Like

Looks like, thank you so much maybe it’s a common mistake forget about the easy things

1 Like

Sometimes we over think things and miss the small things.

1 Like