summary refs log tree commit diff
path: root/bin/luxnox-toggle
diff options
context:
space:
mode:
authorskylar <me@casper>2026-11-28 05:59:53 -0800
committerskylar <me@casper>2026-11-28 05:59:53 -0800
commite4306e5435eef76bad7fa9b3b909362304a8a47e (patch)
treed7856752d733cf2ef4551b3f6c6125635060ab58 /bin/luxnox-toggle
luxnox: one palette for light and dark themesHEAD main
palette.toml drives kitty, the dwl desktop (dwl, fuzzel, swaync, wob, wmenu), GTK, Qt, the console and Emacs; luxnox-toggle switches lux and nox. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'bin/luxnox-toggle')
-rwxr-xr-xbin/luxnox-toggle18
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"