#!/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"