From 81d1fc4fe090e70cefc274ba617c4d2a67e85373 Mon Sep 17 00:00:00 2001 From: Diogo Pinela Date: Sat, 12 Oct 2019 11:41:45 +0100 Subject: [PATCH] Detect macOS Mojave accent colors and dark mode --- screenfetch-dev | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/screenfetch-dev b/screenfetch-dev index 4562109..1e815a4 100755 --- a/screenfetch-dev +++ b/screenfetch-dev @@ -2362,11 +2362,38 @@ detectwmtheme () { Win_theme="Not Found" if [[ "${distro}" == "Mac OS X" ]]; then themeNumber="$(defaults read NSGlobalDomain AppleAquaColorVariant 2>/dev/null)" + accentColorNumber="$(defaults read NSGlobalDomain AppleAccentColor 2>/dev/null)" + interfaceStyle="$(defaults read NSGlobalDomain AppleInterfaceStyle 2>/dev/null)" if [ "${themeNumber}" == "1" ] || [ "${themeNumber}x" == "x" ]; then - Win_theme="Blue" + case "${accentColorNumber}" in + "5") + Win_theme="Purple" + ;; + "6") + Win_theme="Pink" + ;; + "0") + Win_theme="Red" + ;; + "1") + Win_theme="Orange" + ;; + "2") + Win_theme="Yellow" + ;; + "3") + Win_theme="Green" + ;; + *) + Win_theme="Blue" + ;; + esac else Win_theme="Graphite" fi + if [ "${interfaceStyle}" == "Dark" ]; then + Win_theme="${Win_theme} (Dark)" + fi elif [[ "${distro}" == "Cygwin" || "${distro}" == "Msys" ]]; then if [ "${WM}" == "Blackbox" ]; then if [ "${distro}" == "Msys" ]; then