Add macOS Light/Dark theme detection
This commit is contained in:
parent
3344bbf8c7
commit
80d7cef7a0
19
neofetch
19
neofetch
|
@ -926,14 +926,21 @@ get_wm_theme() {
|
|||
;;
|
||||
|
||||
"Quartz Compositor")
|
||||
wm_theme="$(PlistBuddy -c "Print AppleAquaColorVariant" \
|
||||
"${HOME}/Library/Preferences/.GlobalPreferences.plist")"
|
||||
global_preferences="${HOME}/Library/Preferences/.GlobalPreferences.plist"
|
||||
wm_theme="$(PlistBuddy -c "Print AppleInterfaceStyle" "$global_preferences")"
|
||||
wm_theme_color="$(PlistBuddy -c "Print AppleAquaColorVariant" "$global_preferences")"
|
||||
|
||||
if [[ -z "$wm_theme" ]] || ((wm_theme == 1)); then
|
||||
wm_theme="Blue"
|
||||
else
|
||||
wm_theme="Graphite"
|
||||
if [[ -z "$wm_theme" ]]; then
|
||||
wm_theme="Light"
|
||||
fi
|
||||
|
||||
if [[ -z "$wm_theme_color" ]] || ((wm_theme_color == 1)); then
|
||||
wm_theme_color="Blue"
|
||||
else
|
||||
wm_theme_color="Graphite"
|
||||
fi
|
||||
|
||||
wm_theme="$wm_theme_color ($wm_theme)"
|
||||
;;
|
||||
|
||||
*"Explorer")
|
||||
|
|
Reference in New Issue