Skip to content

Add a fallback if theirs no /sys/class/power_supply/BAT0/ #3

@nonetrix

Description

@nonetrix

I use Gentoo and I have battery support disabled in my kernel completely since I am on a desktop so theirs no /sys/class/power_supply/BAT0/ at all instead of saying something like no battery detected it crashes

nonetrix@archbtw ~/Downloads/paleofetch-master $ ./paleofetch
                  -`
                 .o+`                   nonetrix@archbtw
                `ooo/                   ----------------
               `+oooo:                  OS:  x86_64
              `+oooooo:                 Host: B450 AORUS PRO WIFI Default string
              -+oooooo+:                Kernel: 5.10.27-gentoo
            `/:-:++oooo+:               Uptime: 24 mins
paleofetch: Unable to get battery information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions