NoSignal-OS/os updates/app-theme-awareness/install-app-theme-awareness.sh
28allday 19fd794b6b NoSignal — fully-offline Arch → Hyprland desktop installer
Single-script builder (nosignal.sh) that turns a stock Arch Linux ISO into a
fully-offline installer for a themed Hyprland + caelestia (Quickshell) desktop:
matching SDDM greeter, Btrfs/Limine bootable snapshots, chwd-style GPU
detection, and a curated "os updates" layer (keybind cheatsheet, settings
panels, system polish, on-box management skill). See README.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 11:03:10 +01:00

39 lines
1.7 KiB
Bash
Executable file

#!/bin/sh
# install-app-theme-awareness.sh — idempotent. User-level (no root).
#
# External apps (Chrome, Electron, Firefox, GTK, Qt) don't follow
# the desktop theme because nothing publishes a color-scheme preference — the
# portal reports "no preference" (0). This installs a sync that mirrors
# Caelestia's light/dark mode to the freedesktop appearance portal + GTK, and
# units that re-run it on every scheme change.
set -eu
HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
BIN="$HOME/.local/bin"
UNITS="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user"
PORTAL="${XDG_CONFIG_HOME:-$HOME/.config}/xdg-desktop-portal"
install -Dm0755 "$HERE/nosignal-app-theme-sync" "$BIN/nosignal-app-theme-sync"
install -Dm0644 "$HERE/nosignal-app-theme.service" "$UNITS/nosignal-app-theme.service"
install -Dm0644 "$HERE/nosignal-app-theme.path" "$UNITS/nosignal-app-theme.path"
echo "installed sync script + user units"
# portals.conf: only create if the user doesn't already have one (don't clobber)
if [ ! -e "$PORTAL/portals.conf" ]; then
install -Dm0644 "$HERE/portals.conf" "$PORTAL/portals.conf"
echo "installed $PORTAL/portals.conf (Settings=gtk)"
else
echo "note: $PORTAL/portals.conf exists — leaving it; ensure it has org.freedesktop.impl.portal.Settings=gtk"
fi
# enable the watcher + run an initial sync (needs a running user systemd bus)
if systemctl --user show-environment >/dev/null 2>&1; then
systemctl --user daemon-reload
systemctl --user enable --now nosignal-app-theme.path nosignal-app-theme.service || true
echo "enabled nosignal-app-theme.{path,service}"
else
echo "note: no user systemd bus here — units installed; they start at next login"
"$BIN/nosignal-app-theme-sync" || true
fi
echo "app-theme-awareness: ok"