Skip to content

How to conditionally display battery info #63

Closed
@bcc32

Description

@bcc32

I have the following snippet in my status-right:

#{?#{!=:#{battery_percentage},}, #{battery_status_bg} #{battery_remain} [#{battery_percentage}],}

The idea being that I only want to display battery info, etc. if the current machine I'm on actually has a battery. However, when I do have a battery, I get output like ~1:27 [] instead of ~1:27 [22%] as expected.

Is there a better way to detect the presence/absence of a battery rather than just testing the output of #{battery_percentage}?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions