summary refs log tree commit diff
path: root/Makefile
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 /Makefile
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 'Makefile')
-rw-r--r--Makefile83
1 files changed, 83 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..164a1e2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,83 @@
+PREFIX ?= $(HOME)/.local
+DATA ?= $(HOME)/.local/share/luxnox
+KITTY ?= $(HOME)/.config/kitty
+DWL ?= $(HOME)/Projects/dwl
+GTK4 ?= $(HOME)/.config/gtk-4.0
+THEMES ?= $(HOME)/.local/share/themes
+QT6CT ?= $(HOME)/.config/qt6ct
+QT_FLATPAKS ?= org.qbittorrent.qBittorrent
+
+.PHONY: all check gen install install-kitty install-desktop install-gtk install-emacs install-qt install-dwl install-console clean
+
+all: gen
+
+check:
+ ./luxnox check
+
+gen:
+ ./luxnox gen
+
+install: install-kitty install-desktop install-gtk install-emacs install-qt install-dwl
+
+# kitty picks these up itself and follows the system color-scheme.
+install-kitty: gen
+ install -Dm644 build/kitty/nox.conf $(KITTY)/dark-theme.auto.conf
+ install -Dm644 build/kitty/lux.conf $(KITTY)/light-theme.auto.conf
+ install -Dm644 build/kitty/luxnox.conf $(KITTY)/luxnox.conf
+ grep -qx 'include luxnox.conf' $(KITTY)/kitty.conf 2>/dev/null || echo 'include luxnox.conf' >> $(KITTY)/kitty.conf
+ -pkill -USR1 -x kitty
+
+# fuzzel, wob, swaync, swaylock, wmenu: luxnox-apply links the current mode's set.
+install-desktop: gen
+ install -Dm755 bin/luxnox-toggle $(PREFIX)/bin/luxnox-toggle
+ install -Dm755 bin/luxnox-apply $(PREFIX)/bin/luxnox-apply
+ install -Dm755 bin/luxnox-menu $(PREFIX)/bin/luxnox-menu
+ for m in lux nox; do \
+ for f in build/$$m/*; do install -Dm644 $$f $(DATA)/$$m/$${f##*/}; done; \
+ done
+ -systemctl --user try-restart wob.service
+ -pgrep -x swaync >/dev/null && swaync-client --reload-css >/dev/null
+
+# GTK4/libadwaita: one file with both modes. GTK3: a theme per mode, which
+# luxnox-apply selects (gsettings gtk-theme): luxnox or luxnox-dark, named
+# like adw-gtk3 so libhandy apps find the dark variant (see ./luxnox).
+install-gtk: gen
+ install -Dm644 build/gtk/gtk-4.0.css $(GTK4)/gtk.css
+ for t in luxnox luxnox-dark; do \
+ for f in gtk.css gtk-dark.css; do \
+ install -Dm644 build/gtk/$$t/gtk-3.0/$$f $(THEMES)/$$t/gtk-3.0/$$f; \
+ done; \
+ done
+
+# Emacs: on custom-theme-load-path via the Doom config; auto-dark switches.
+install-emacs: gen
+ for m in lux nox; do install -Dm644 build/emacs/$$m-theme.el $(DATA)/emacs/$$m-theme.el; done
+
+# Qt: qt6ct palettes, which luxnox-apply selects in qt6ct.conf.
+# Flatpak Qt apps can't load the host's qt6ct; point them at the KDE runtime's
+# platform theme, which follows the kdeglobals luxnox-apply writes
+# (installed per mode by install-desktop). Restart the app once afterwards.
+install-qt: gen
+ for m in lux nox; do install -Dm644 build/qt/luxnox-$$m.conf $(QT6CT)/colors/luxnox-$$m.conf; done
+ -for app in $(QT_FLATPAKS); do flatpak override --user --env=QT_QPA_PLATFORMTHEME=kde $$app; done
+
+# dwl compiles the colors in; rebuild and reinstall dwl after this.
+install-dwl: gen
+ install -m644 build/dwl/luxnox.h $(DWL)/luxnox.h
+ @echo "now rebuild dwl: cd $(DWL) && make && sudo make install"
+
+# Text consoles and tuigreet: always nox. Needs root, so it's not part of
+# install: `make gen` as yourself first (so build/ stays yours), then
+# `sudo make install-console`. Restarting the unit reloads the colors.
+CONSOLE_DATA ?= /usr/local/share/luxnox
+UNIT_DIR ?= /usr/local/lib/systemd/system
+install-console:
+ @test -f build/console/vtrgb || { echo "run 'make gen' first (not as root)"; exit 1; }
+ install -Dm644 build/console/vtrgb $(CONSOLE_DATA)/vtrgb
+ install -Dm644 system/luxnox-console.service $(UNIT_DIR)/luxnox-console.service
+ systemctl daemon-reload
+ systemctl enable luxnox-console.service
+ systemctl restart luxnox-console.service
+
+clean:
+ rm -rf build