Files
noctalia-greeter/sync/noctalia-greeter-sync
Moze 1dd16d3e99 feat: initial noctalia-greeter release
QuickShell QML login greeter for greetd, styled after noctalia-shell
lockscreen. Runs under niri compositor as _greeter user. Theme is
live-synced from noctalia config via runit service.

- shell.qml: QuickShell greeter UI + greetd auth flow
- sync/: inotifywait theme sync daemon + runit service
- greetd/: niri compositor config + wrapper scripts
- install.sh: deployment helper
- test/check-syntax.sh: 19 syntax/structural checks (0 failures)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-30 01:45:37 +02:00

50 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# Syncs noctalia theme to /var/lib/noctalia-greeter-theme/ for the _greeter user.
export HOME=/home/moze
export USER=moze
THEME_DIR="/var/lib/noctalia-greeter-theme"
COLORS="$HOME/.config/noctalia/colors.json"
WALLPAPERS_JSON="$HOME/.cache/noctalia/wallpapers.json"
do_sync() {
if [ -f "$COLORS" ]; then
cp -f "$COLORS" "$THEME_DIR/colors.json" 2>/dev/null
chmod 644 "$THEME_DIR/colors.json" 2>/dev/null
fi
if [ -f "$WALLPAPERS_JSON" ]; then
WP=$(python3 -c "
import json, sys
try:
d = json.load(open('$WALLPAPERS_JSON'))
m = d.get('wallpapers', {})
for s in ['eDP-1', 'DP-1'] + list(m.keys()):
if s in m:
p = m[s].get('dark') or m[s].get('light') or ''
if p:
print(p)
sys.exit(0)
fb = d.get('defaultWallpaper', '')
if fb: print(fb)
except Exception as e:
sys.stderr.write(str(e) + chr(10))
" 2>/dev/null)
if [ -n "$WP" ] && [ -f "$WP" ]; then
cp -f "$WP" "$THEME_DIR/wallpaper.jpg" 2>/dev/null
chmod 644 "$THEME_DIR/wallpaper.jpg" 2>/dev/null
fi
fi
}
do_sync
exec inotifywait -m -q \
-e close_write,moved_to,create \
"$HOME/.config/noctalia/" \
"$HOME/.cache/noctalia/" 2>/dev/null |
while IFS= read -r _line; do
sleep 0.3
do_sync
done