Files
desktop-planer/dev/eval.sh
2026-09-18 22:02:53 +02:00

12 lines
504 B
Bash
Executable File

#!/bin/bash
# JavaScript in der nested Shell ausführen: dev/eval.sh 'code' oder dev/eval.sh datei.js
SCRATCH=${SCRATCH:-/tmp/desktop-app-nested}
export DBUS_SESSION_BUS_ADDRESS=$(cat "$SCRATCH/bus")
if [ -f "$1" ]; then
CODE="eval(new TextDecoder().decode(GLib.file_get_contents('$(realpath "$1")')[1]))"
else
CODE="$1"
fi
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "$CODE" \
| sed -e 's/^(true, /OK /' -e 's/^(false, /FEHLER /'