on master help sign in
add dark mode script
a736889Jerguš Lejko
README.md+10
@@ -416,6 +416,16 @@ will hopefully enable both quit-if-one-screen and mouse-wheel scrolling.
416
416
417If scrolling still doesn't work for you, you can try to pass the `-S` option in addition.
417If scrolling still doesn't work for you, you can try to pass the `-S` option in addition.
418
418
419+### Dark mode
420+
421+If you make use of the dark mode feature in macOS, you might want to configure `bat` to use a different
422+theme based on the OS theme. The following snippet uses the `default` theme when in the light mode
423+and the `GitHub` theme when in the dark mode.
424+
425+```
426+alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
427+```
428+
419## Configuration file
429## Configuration file
420
430
421`bat` can also be customized with a configuration file. The location of the file is dependent
431`bat` can also be customized with a configuration file. The location of the file is dependent