mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 00:12:50 -05:00
matugen: validation
This commit is contained in:
@@ -811,7 +811,6 @@ Singleton {
|
|||||||
const desiredPath = stateDir + "/matugen.desired.json"
|
const desiredPath = stateDir + "/matugen.desired.json"
|
||||||
|
|
||||||
Quickshell.execDetached(["sh", "-c", `mkdir -p '${stateDir}' && cat > '${desiredPath}' << 'EOF'\n${json}\nEOF`])
|
Quickshell.execDetached(["sh", "-c", `mkdir -p '${stateDir}' && cat > '${desiredPath}' << 'EOF'\n${json}\nEOF`])
|
||||||
Quickshell.execDetached(["rm", "-f", stateDir + "/matugen.key"])
|
|
||||||
workerRunning = true
|
workerRunning = true
|
||||||
const syncModeWithPortal = (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal) ? "true" : "false"
|
const syncModeWithPortal = (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal) ? "true" : "false"
|
||||||
if (rawWallpaperPath.startsWith("we:")) {
|
if (rawWallpaperPath.startsWith("we:")) {
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ LOCK="$STATE_DIR/matugen-worker.lock"
|
|||||||
exec 9>"$LOCK"
|
exec 9>"$LOCK"
|
||||||
flock 9
|
flock 9
|
||||||
|
|
||||||
|
rm -f "$BUILT_KEY"
|
||||||
|
|
||||||
read_desired() {
|
read_desired() {
|
||||||
[[ ! -f "$DESIRED_JSON" ]] && { echo "no desired state" >&2; exit 0; }
|
[[ ! -f "$DESIRED_JSON" ]] && { echo "no desired state" >&2; exit 0; }
|
||||||
@@ -290,6 +291,13 @@ EOF
|
|||||||
SURFACE=$(echo "$JSON_FLAT" | sed -n "s/.*\"surface\" *: *{ *[^}]*\"$mode\" *: *\"\\(#[0-9a-fA-F]\\{6\\}\\)\".*/\\1/p")
|
SURFACE=$(echo "$JSON_FLAT" | sed -n "s/.*\"surface\" *: *{ *[^}]*\"$mode\" *: *\"\\(#[0-9a-fA-F]\\{6\\}\\)\".*/\\1/p")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$PRIMARY" ]]; then
|
||||||
|
echo "Error: Failed to extract PRIMARY color from matugen JSON (mode: $mode)" >&2
|
||||||
|
echo "This may indicate an incompatible matugen JSON format" >&2
|
||||||
|
set_system_color_scheme "$mode"
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v ghostty >/dev/null 2>&1 && [[ -f "$CONFIG_DIR/ghostty/config-dankcolors" ]]; then
|
if command -v ghostty >/dev/null 2>&1 && [[ -f "$CONFIG_DIR/ghostty/config-dankcolors" ]]; then
|
||||||
OUT=$("$SHELL_DIR/matugen/dank16.py" "$PRIMARY" $([[ "$mode" == "light" ]] && echo --light) ${HONOR:+--honor-primary "$HONOR"} ${SURFACE:+--background "$SURFACE"} 2>/dev/null || true)
|
OUT=$("$SHELL_DIR/matugen/dank16.py" "$PRIMARY" $([[ "$mode" == "light" ]] && echo --light) ${HONOR:+--honor-primary "$HONOR"} ${SURFACE:+--background "$SURFACE"} 2>/dev/null || true)
|
||||||
if [[ -n "${OUT:-}" ]]; then
|
if [[ -n "${OUT:-}" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user