diff --git a/src/gnome-shell.in b/src/gnome-shell.in index 2acc967ed..e5ef5095e 100644 --- a/src/gnome-shell.in +++ b/src/gnome-shell.in @@ -212,6 +212,8 @@ parser.add_option("", "--geometry", metavar="GEOMETRY", default="1024x768"); parser.add_option("-w", "--wide", action="store_true", help="Use widescreen (1280x800) with Xephyr") +parser.add_option("", "--eval-file", metavar="EVAL_FILE", + help="Evaluate the contents of the given JavaScript file") options, args = parser.parse_args() @@ -219,6 +221,20 @@ if args: parser.print_usage() sys.exit(1) +if options.eval_file: + import dbus + + f = open(options.eval_file) + contents = f.read() + f.close() + + session = dbus.SessionBus() + shell = session.get_object('org.gnome.Shell', '/org/gnome/Shell') + shell = dbus.Interface(shell, 'org.gnome.Shell') + result = shell.Eval(contents) + print result + sys.exit(0) + if options.debug_command: options.debug = True elif options.debug: