How to test / debug GNOME Shell extensions? Is there a tool for this?

I would like to develop GNOME Shell extensions and found it very easy to enter the development process, but I still cannot figure out how to efficiently debug / test my extensions.

Are there any tools for this purpose? Is there any real-time console like modern browsers or javascript servers?

+44
javascript gnome-3 gnome-shell gnome-shell-extensions
Dec 08 2018-11-11T00:
source share
8 answers

Yes, the real-time console is called “Look Glass” and can be started by pressing Alt + F2 and typing lg at the prompt.

Additional information: https://live.gnome.org/GnomeShell/LookingGlass

+41
Dec 08 2018-11-11T00:
source share

In Fedora 20 (and possibly in any new linux distribution) you can use this command:

 journalctl /usr/bin/gnome-session -f -o cat 

It constantly ( -f ) prints the errors generated by gnome-session in the terminal window. I prefer the -o cat flag as it shows full messages without timelines.

On Fedora 22, I believe it has been replaced by:

 journalctl /usr/bin/gnome-shell -f -o cat 
+26
Jul 31 '14 at 21:08
source share

Through the looking glass is excellent. If you need a direct console, you can get it, but not through LG, at least not 3.6.

If you open a terminal and type gnome-shell --replace , gnome-shell --replace will be launched from it, the executable instance will be replaced instead, and then the global log will be displayed.

You can check it with Glass Glass by running Alt - F2 lg and then global.log("foo") on the global.log("foo") tab.

+16
Feb 26 '13 at 16:11
source share

I prefer to read ~/.xsession-errors and ~/.cache/gdm/session.log files for more details. Some error messages may be related to other exceptions or errors.

+7
Dec 28 '13 at 10:22
source share

I still can not comment on other answers, so I thought that I would add - no matter how late it is:

  • For comment 2 of Jeff’s answer, just restart the shell via alt+f2 - then r and enter , when that happens - the terminal session will end automatically (at least on Debian).

  • I would recommend jsnjack answer for general debugging, which also works with Debian Jessy; probably want sudo though. It will show gnome errors, as well as global.log () messages in any terminal where you ran it.

If something, this gives a more complete link for me - since I came across this page more than once, referring to information that I do not store in my memory.

+3
Oct. 20 '14 at 1:45
source share

Anjuta Dev-Studio is a great tool for working with gnome-shell extensions; it is equipped with a debugger, a GUI designer, version control, etc. There's even a tutorial on using Anjuta with gnome-shell extension projects over gnome wiki-pages

+2
Jan 26 '14 at 21:26
source share

Other answers didn't really work for me when developing my own extension. What was it:

 journalctl /usr/lib/gnome-session/gnome-session-binary -f -o cat 

If you want to declare output only for your application, you can use:

 journalctl /usr/lib/gnome-session/gnome-session-binary -f -o cat | grep [myAppId] 

If you also want to access error logs using the above method above, you can use:

 global.log('[myAppId]', valueToLog); 

If you do not know the correct path to the gnome session, you can also use:

 journalctl -f | grep gnome-session 

Why it does not work, probably due to my binary path related to gnome-session, was different, which may be due to installing a newer version of gnome.

+1
Apr 27 '17 at 10:02
source share

We are developing an emacs package designed to extend the gnome-shell extension here: https://github.com/paperwm/gnome-shell-mode

It is still in beta (dec. 2017), but its already very useful.

Functions

  • Autocompletion (muuuch is better than looking glass)
  • Eval of line, selection, current function, buffer (optionally inserting the result into the buffer in the comment)
  • Bypass error highlighting
  • Documentation Search Assistant
  • Assistant to reload the module you are working on without restarting gnome-shell
0
Dec 08 '17 at 23:44
source share



All Articles