19 lines
526 B
Bash
Executable file
19 lines
526 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# vim: ft=bash
|
|
|
|
print_json() {
|
|
case "$1" in
|
|
prefer-dark)
|
|
echo '{"text": "dark", "alt": "dark", "class": "dark", "tooltip": "Dark mode"}'
|
|
;;
|
|
prefer-light)
|
|
echo '{"text": "light", "alt": "light", "class": "light", "tooltip": "Light mode"}'
|
|
;;
|
|
esac
|
|
}
|
|
|
|
print_json "$(gsettings get org.gnome.desktop.interface color-scheme | cut -nd"'" -f 2)"
|
|
gsettings monitor org.gnome.desktop.interface color-scheme | while read -r l; do
|
|
print_json "$(echo "$l" | cut -d"'" -f 2)"
|
|
done
|
|
|