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 Print Text to DrawingArea in Gnome-Shell-Extension

I'm doing my first gnome-shell extension (gnome shell 41.3) and I seem to encounter the most common problems, finding the right manual for that... What I try to achive is... A Widget shown (above everything) on the desktop... Draw something into…
Zappo-II
  • 21
  • 5
0
votes
2 answers

Can I get a hover and checked effect with St.Button in GJS?

I have a group button with icon. If I can setup a hover effect, for I saw here is some func or attribute like St.Widget.track-hover St.Widget.sync_hover St.Widget.set_hover, maybe minor changes may be made for buttons using css. But those function…
eexpress
  • 386
  • 1
  • 14
0
votes
1 answer

Can I set_markup to a PopupMenuItem?

Since a Label in a PopupMenuItem, I thinks it can be set a pango text here. PopupMenuItem: A PopupBaseMenuItem that displays text in a St.Label. const item = new PopupMenu.PopupMenuItem(""); item.actor.set_size(300,150); <---…
eexpress
  • 386
  • 1
  • 14
0
votes
0 answers

Can I use ajax in gjs or any alternatives method?

[gnome-sehll-extension] I need read other web pages and parse the obtained JSON files. The office example is: $.ajax({ url: 'http://api.xxx/yyyy', type: 'get', dataType: 'jsonp', data: { q: query, appid: appid, …
eexpress
  • 386
  • 1
  • 14
0
votes
1 answer

Want add variables to PopupMenu class and save object in array in gjs

I want store two variable with PopupMenu.PopupImageMenuItem object, and push them into an array, then want change the text of those popupmenuitems later every 10 seconds. var list = new Array(); function add_timer (){ …
eexpress
  • 386
  • 1
  • 14
0
votes
1 answer

cairo in gnome extension, nothing show

I write simple test cairo code, mainly from office example code. but nothing show in the menu area. It hard to describe, so put screenshot here. please help.
eexpress
  • 386
  • 1
  • 14
0
votes
0 answers

What principle makes the system stock icon automatically adapt to the gnome shell theme?

I test a gnome shell extension. When I set a icon using icon_name, I think the gnome shell search and find the icon in system icon path, just like "/usr/share/icons/Adwaita/scalable/status/alarm-symbolic.svg". And the icon display in panel show…
eexpress
  • 386
  • 1
  • 14
0
votes
1 answer

How to analyze image in gjs/gnome-extensions?

How I can get pixel of image in gjs/gnome-extensions? I tried Image() but it undefined in system.
Renattele Renattele
  • 1,626
  • 2
  • 15
  • 32
0
votes
1 answer

How to change the color of _selected_ text in a `St.Entry` in a Cinnamon Applet (Gnome)?

I use a St.Entry widget in an Cinnamon applet and set the text color via CSS to black. By chance the selection color of this widget it also black - at least in the theme I use: This way, selected text is unreadable. :-( How can I change the…
Peter T.
  • 2,927
  • 5
  • 33
  • 40
0
votes
1 answer

How to get a `St.BoxLayout` to 100% width in a Cinnamon applet (CJS / GJS)?

I am writing my first Cinnamon applet (after I managed to write a desklet). I have a St.BoxLayout embedded in a PopupMenu.PopupBaseMenuItem in order to get in in a popup menu. Now I want it's width to be 100% of the popup menu width, but it (i.e.…
Peter T.
  • 2,927
  • 5
  • 33
  • 40
0
votes
1 answer

Gnome shell extension login callback

I've created a custom GJS extension to connect into VPN. Basically it's a wrapper around a shell script, which is controlled from taskbar. There is a one issue, that after PC goes into suspend mode and back, extension is still displaying, that is…
Andy
  • 74
  • 9
0
votes
1 answer

Update ScrollView when height of a notification in the notification tray changes

So in regards to my last question, I am currently struggling with expanded notifications clogging up the notification tray. The problem is, that the vertical ScrollBar of the notification tray does not show up when it needs to when e.g. too many…
kaanginam
  • 17
  • 4
0
votes
1 answer

Showing more than one line of the notification description in the notification tray using an extension

I am currently designing an extension to make the notifications in the notification section of the calendar expendable. The goal is to make the noficiation expand like the initial notification on the desktop does. I have changed the type of…
kaanginam
  • 17
  • 4
0
votes
1 answer

proper use of SSL certificate with Soup in javascript

I would like to ask how to properly use Soup in gnome-shell extension with a certificate on the client site. The snippet of my code looks like this: const Soup = imports.gi.Soup; const GObject = imports.gi.GObject; const Gio = imports.gi.Gio; const…
smurfik
  • 3
  • 2
0
votes
2 answers

gjs/gnome-shell-extension: Updating button text every 60 seconds

I want to write a simple gnome extension that prints some text on my top bar from a text file. I managed to print the text but i'm having trouble with updating it every 60 seconds. Is it even possible with gjs? this is what i came up with: const…
karol
  • 1