diff options
Diffstat (limited to 'bin/luxnox-toggle')
| -rwxr-xr-x | bin/luxnox-toggle | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/luxnox-toggle b/bin/luxnox-toggle new file mode 100755 index 0000000..eb727d3 --- /dev/null +++ b/bin/luxnox-toggle @@ -0,0 +1,18 @@ +#!/bin/sh +# Flip the system color scheme between dark (nox) and light (lux). +# Apps that follow org.gnome.desktop.interface color-scheme (kitty via the +# portal, GTK, later Emacs) switch on their own. +# luxnox-toggle [dark|light] +key=org.gnome.desktop.interface +# Always the plain "user" dconf database, which the GTK portal reads. A shell +# started from a session that inherited COSMIC's DCONF_PROFILE would otherwise +# write to COSMIC's database and nothing would change. +unset DCONF_PROFILE +case "${1:-}" in + dark) want=prefer-dark ;; + light) want=prefer-light ;; + "") [ "$(gsettings get $key color-scheme)" = "'prefer-dark'" ] \ + && want=prefer-light || want=prefer-dark ;; + *) echo "usage: luxnox-toggle [dark|light]" >&2; exit 2 ;; +esac +gsettings set $key color-scheme "$want" |