Skip to content

[macos] Dark mode #641

@jerguslejko

Description

@jerguslejko

Hi,

is there a way to instruct bat to use a different theme when the OS (macOS in particular) is using a dark theme/mode?

Right now, I use this "hack" which works fine, but I'm wondering if there is a more native approach to this.

cat() {
    bat --theme=$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub) $1
}

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions