Understand why GNOME Shell's D-Bus Eval() method is disabled by default and script GNOME Shell state safely instead

domain: gitlab.gnome.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Introspect the Shell's D-Bus interface first with gdbus introspect --session --dest org.gnome.Shell --object-path /org/gnome/Shell (or busctl --user introspect org.gnome.Shell /org/gnome/Shell) to see what's callable without Eval
  2. For read/observe needs, call specific exposed methods or properties directly via gdbus call/busctl call instead of Eval — most extensions and GNOME components expose their own dedicated D-Bus interfaces for this
  3. If arbitrary JS execution is genuinely required (e.g. driving the Looking Glass evaluator programmatically for debugging), explicitly enable the shell's unsafe-mode toggle before calling org.gnome.Shell.Eval
  4. Re-disable unsafe mode after the debugging/automation session so the machine isn't left with an open arbitrary-code-execution D-Bus surface
  5. For extension automation specifically, prefer calling the extension's own custom D-Bus interface, if it exposes one, over reaching into it via Shell.Eval

Known gotchas

Related routes

Call a D-Bus method and inspect available D-Bus services/objects from a shell script using busctl or gdbus
freedesktop.org · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans