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
1 answer

How to get files from selected folder with GtkFileChooserButton?

I am making a GTK+3 App with GJS where users select a folder from a GtkFileChooserButton (action property set to select-folder). I want to find all image files in the given folder the user have selected, so I can display one of the images. I tried…
Bastian
  • 620
  • 5
  • 14
0
votes
1 answer

initFormat doesn't join the string correctly on my code

I'm studying GCampax Gtk+Gjs example[1], and wondering how to use initFormat. AFAIK it is a JS functionality to put together strings and variables, working such as print("Hello, {0}".format("World")); //--> Hello, World but it seem that doesn't…
medeoTL
  • 13
  • 2
0
votes
1 answer

Unknown option -D Gjs

Gjs documentation says gjs -D -S example.js will start a debugger but when I do the same follow error occurs $ gjs -D test.js (gjs:26381): Gjs-ERROR **: 06:18:06.759: option parsing failed: Unknown option -D Trace/breakpoint trap (core dumped) I…
Nauman Umer
  • 1,006
  • 1
  • 11
  • 21
0
votes
0 answers

Dynamically change the color of the title in a GNOME shell application window

I am writing a GNOME shell extension in gjs (JavaScript) that changes the color of the title in a GNOME shell application window depending on what the text says. Right now, I am trying to get this working for Text Editor. I want to change the title…
0
votes
1 answer

How to get Clutter.Actor via its name

I am using GJS, how do I get Clutter.Actor via its name. For example, if I wanted to get GNOME Shell's top panel, how do I get its Clutter.Actor via its name "panel"? My research ended up somewhere along Clutter.Stage which is where Actor(s) can go…
Gelo Tress
  • 53
  • 4
0
votes
1 answer

How can I check error code in Gnome/gjs/Gio

This doesn't work (nothing happens when the directory exists): let s_dir = Gio.file_new_for_path("./S1"); try { s_dir.make_directory(null); } catch(e) { if(e == Gio.IOErrorEnum.EXISTS) print(e); }
eiro
  • 72
  • 1
  • 8
0
votes
1 answer

gnome-shell-extensions drag and drop

While trying to add D&D support to a gnome-shell-extension that I'm writing I ran into a bit of trouble. I can create drop targets to any open window, but that's all I've managed to pull off. I can't differentiate between the windows. I tried to use…
varikas
  • 21
  • 5
0
votes
1 answer

How can I get the SHA1 fingerprint of a TlsCertificate in GJS?

I'm trying to get a fingerprint of a Gio.TlsCertificate of a connection, which as I understand it is just a SHA1 checksum of the certificate in DER form. So I think I could use GLib.compute_checksum_for_data() on the certificate property of the…
andy.holmes
  • 3,383
  • 17
  • 28
0
votes
1 answer

How can I get the remote address from an incoming message on UDP listener socket?

Although it's possible to read from a Gio.Socket by wrapping it's file-descriptor in Gio.DataInputStream, using Gio.Socket.receive_from() in GJS to receive is not possible because as commented here: GJS will clone array arguments before passing…
andy.holmes
  • 3,383
  • 17
  • 28
0
votes
1 answer

Get enabled extensions from org.gnome.shell schema in GJS

I am trying to obtain the value stored in the org.gnome.shell schema with the enabled extensions. But this sentence says that the org.gnome.shell schema is not installed let extensionsSchema = new Gio.Settings({ schema: 'org.gnome.shell' }); I am…
codiaf
  • 569
  • 2
  • 18
  • 47
0
votes
1 answer

Load Gtk.Image from resource in GJS

I am trying to load a Gtk.Image from a resource but I can't figure it out what I am doing wrong. I have the png in my gresource.xml
codiaf
  • 569
  • 2
  • 18
  • 47
0
votes
1 answer

How can I access gnome-contacts or its data from gjs

According to this answer (and comments) gnome-contacts is where contacts are centralized for Gnome and it does a good job of aggregating via telepathy, but the only way to access that information seems to be the Gnome Shell search provider which…
andy.holmes
  • 3,383
  • 17
  • 28
0
votes
0 answers

cygwin gjs segfault: egList.js, egSpawn.js and egSearch.js

gjs-examples (https://github.com/optimisme/gjs-examples): egList.js, egSpawn.js and egSearch.js are cause segmentation fault. gjs version is 1.44.0-1 (cygwin) methods that cause segmentation fault: egList.js …
viktor_aky
  • 31
  • 5
0
votes
2 answers

gjs/gnome-shell-extension: read remote jpg image from url and set as icon

I am trying to improve a gnome-shell-extension by allowing retrieving of remote image (jpg) and set as icon for a certain widget. Here is what I got so far, but it does not work, due to mismatch of data type: // allow remote album art url const…
Jerry Ma
  • 511
  • 4
  • 15
0
votes
1 answer

Consume a webservice with basic authentication using Soup

As part of a gnome-shell extension, I try to consume a webservice using xmlrpc. The webservice expects a basic authentication header. Using Soup, I got the following code (basically a blueprint from the great openweather extension): function…
L-Ray
  • 1,637
  • 1
  • 16
  • 29
1 2 3
12
13