Questions tagged [gjs]

Gjs is a JavaScript binding for GNOME. It allows to create desktop-applications with JavaScript.

Gjs is mainly based on the Spidermonkey javascript engine (by Mozilla) and the GObject introspection framework. It uses Gtk-bindings to enable the user to create real desktop-applications.

Gjs is part of and is also used to create gnome-shell-extensions.

Useful links

193 questions
0
votes
0 answers

Encrypt a string with JavaScript in a Gnome Applet

Is there a easy way to encrypt for example a string with AES in a gnome applet written in JavaScript? I can't find a solution in the gnome api reference [1]. I saw that libsecret has a AES implementation for testing purposes [2], but I don't know if…
Eich
  • 3,728
  • 1
  • 21
  • 34
0
votes
1 answer

Expected type utf8 for Argument 'sql' but got type 'object'

I'm trying a GNOME JavsScript tutorial, that seems not to work in its original version. var gdaStrConn = Gda.Connection.open_from_string("SQLite", "DB_DIR=" + GLib.get_home_dir () + ";DB_NAME=gnome_demo", null, 0); print('Connected'); …
BuZZ-dEE
  • 6,075
  • 12
  • 66
  • 96
0
votes
1 answer

How to set the requested presence with Telepathy-Glib-GJS?

According to the Telepathy Developer's Manual: "To bring an account online, set RequestedPresence to an online state[..]" For TelepathyGlib.Account under GJS I can see a TelepathyGLib.Account.prototype.get_requested_presence but not an equivalent…
Bastian
  • 620
  • 5
  • 14
0
votes
1 answer

How to use the Gtk ComboBox in gjs?

Following some PyGTK tutorials, I'm trying to fill a combo box in gjs (native javascript on the Gnome desktop) So far I came up with two similar ways that both almost work. The first one is probably closest to the example in the tutorial: var…
lyle
  • 757
  • 1
  • 7
  • 18
0
votes
1 answer

how do i load a page into a string with Soup.SessionAsync without the use of callbacks

I've made a nice desklet which among other things load a page from a url into a variable like this let url = 'http://localhost/page.php'; let file = Gio.file_new_for_uri(url).load_contents(null); let doc=(file[1]+"") return doc; This work great…
0
votes
1 answer

Display object details in unit test

Using JsUnit, I am trying to make use of the assertEquals function, such that when a suite of tests fail, they will print useful information as to why they failed. My current situation is such: let actual = some_method_call (); let expected = [ …
BlackVegetable
  • 12,594
  • 8
  • 50
  • 82
0
votes
2 answers

Unable to open a GtkWindow from a cinnamon applet

When I try to open a GtkWindow from a cinnamon applet, the entire desktop freezes. No errors in the ~/.cinnamon/glass.log file. const Gtk = imports.gi.Gtk; function MyApplet(orientation) { this._init(orientation); } MyApplet.prototype = { …
Nicolas
  • 6,289
  • 4
  • 36
  • 51
0
votes
1 answer

With gjs, how can I write Soup.Buffer chunks of data to a file?

I'm writing a GTK javascript program that downloads a file and writes it to disk. Here's what my code looks like: const Gio = imports.gi.Gio; const Soup = imports.gi.Soup; // start an http session to make http requests let _httpSession = new…
micah
  • 353
  • 2
  • 10
0
votes
1 answer

Defining source encoding in standalone JavaScript (gjs)

[this is a question about JavaScript not in web/HTML context] Is there a way to force any particular (i.e. UTF-8) encoding for source JavaScript files in gjs? I'm facing a problem where the first file run directly from command line ($ gjs test.js)…
user319799
0
votes
1 answer

Write extension for gnome-shell 3.4 and 3.6

I am writing an extension for gnome-shell. But in gnome-shell 3.4 a menu is added with panel._menus and in gnome-shell3.6 using with panel.menuManager. How I to add menu that work on every version?
amiad
  • 478
  • 2
  • 7
-1
votes
1 answer

GJS gnome-shell exception error, how to overcome this error

I would like to learn what this error message is. imports.ui.dateMenu.DateMenuButton.prototype.hide() When I run above in lookingGlass, I get below error
PRATAP
  • 127
  • 3
  • 17
-2
votes
1 answer

Reference to "window" in Gnome-shell for use in Gnome extensions

I want to understand how the variable "window" which has the attribute MetaWindow can be used in different functions and vars while not being explicitly defined such as let app = this._tracker.get_window_app(window); and then passed on to other…
1 2 3
12
13