From a736889ef16f2bc3ee61c20745e1b54db0a76cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jergu=C5=A1=20Lejko?= Date: Sun, 15 Sep 2019 14:53:34 +0200 Subject: [PATCH] add dark mode script --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index f238c2ee..1f1b41a6 100644 --- a/README.md +++ b/README.md @@ -416,6 +416,16 @@ will hopefully enable both quit-if-one-screen and mouse-wheel scrolling. If scrolling still doesn't work for you, you can try to pass the `-S` option in addition. +### Dark mode + +If you make use of the dark mode feature in macOS, you might want to configure `bat` to use a different +theme based on the OS theme. The following snippet uses the `default` theme when in the light mode +and the `GitHub` theme when in the dark mode. + +``` +alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)" +``` + ## Configuration file `bat` can also be customized with a configuration file. The location of the file is dependent