2014-02-17 17:19:18 +01:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gjs/gjs.h>
|
|
|
|
#include <glib/gi18n.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
const char *search_path[] = { "resource:///org/gnome/shell", NULL };
|
|
|
|
GError *error = NULL;
|
|
|
|
GjsContext *context;
|
2023-05-25 22:22:09 +02:00
|
|
|
uint8_t status;
|
2014-02-17 17:19:18 +01:00
|
|
|
|
|
|
|
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
|
|
|
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
|
|
|
textdomain (GETTEXT_PACKAGE);
|
|
|
|
|
|
|
|
context = g_object_new (GJS_TYPE_CONTEXT,
|
2023-05-30 14:41:36 +02:00
|
|
|
"program-name", *argv,
|
2014-02-17 17:19:18 +01:00
|
|
|
"search-path", search_path,
|
|
|
|
NULL);
|
|
|
|
|
2023-05-30 14:41:36 +02:00
|
|
|
gjs_context_set_argv(context, argc - 1, (const char**)argv + 1);
|
2014-02-17 17:19:18 +01:00
|
|
|
|
2023-05-25 22:22:09 +02:00
|
|
|
if (!gjs_context_eval_module_file (context,
|
|
|
|
"resource:///org/gnome/shell/portalHelper/main.js",
|
|
|
|
&status,
|
|
|
|
&error))
|
2014-02-17 17:19:18 +01:00
|
|
|
{
|
|
|
|
g_message ("Execution of main.js threw exception: %s", error->message);
|
|
|
|
g_error_free (error);
|
2016-11-29 16:24:44 -08:00
|
|
|
g_object_unref (context);
|
2014-02-17 17:19:18 +01:00
|
|
|
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
2016-11-29 16:24:44 -08:00
|
|
|
g_object_unref (context);
|
2014-02-17 17:19:18 +01:00
|
|
|
return 0;
|
|
|
|
}
|