The reason I'm not happy with the demo code and tutorials is that they introduce a bunch of random imports and never explain what they are or how to use them. I'm constructing my own answer that others can add to, so that people can actually know what functions they can call, what they can import, etc.
There is generated documentation for Gnome Shell, but it is somewhat incomplete — I couldn't find most of the things I saw in various tutorials, examples and published extensions.
The only really reliable documentation is the Gnome Shell source itself. There simply isn't any other up-to-date or complete way to know what's available.
These two starting points are particularly good:
The C source shows that there is an important object called global
that doesn't need to be imported, and provides access to things like the window manager (including keybindings), the session information, the screens available and other such things. Here's the source:
I wanted to know how to use the global.display
object, and for now the best documentation is that provided by Alan Knowles.
Other things can be imported via the GObject introspection bindings, for example:
In general, you can look through the reference documentation for the various Gnome components to find other imports.
A note on the looking glass: There are some quirks about using these imports in the looking glass though — I wasted a lot of time just trying to test things out on the fly. For example:
const Clutter = imports.gi.Clutter;
...won't work, because Clutter
already exists. But then:
const MyClutter = imports.gi.Clutter;
...also won't work; MyClutter
is undefined and can't be used. You have to do:
MyClutter = imports.gi.Clutter;
Of course, in this case Clutter
already exists, so it's not really necessary. But since it's not documented what is and isn't already in the looking glass namespace, if you try to import something and have these problems, keep it in mind.
Remaining questions:
- What is
Mainloop
? This is imported in main.js
and appears to have functions related to the GLib main loop. Is there documentation for this?
- What is
imports.misc
? It seems to have some really useful things in there, like ExtensionUtils
— what's that?
- How do you use DBus? What about introspection?
Never use XAMP. It is third party software with all the possible security problems. I would always avoid third party software if there is a better version.
Use the native LAMP stack (so no need to install all the packages seperatly).
sudo apt-get install tasksel
sudo tasksel
and choose LAMP:
The setup is pre-configured for Ubuntu and asks for a admin password to set up MySQL.
It is the easiest setup there is. Plus you are going to get all the updates for each of the individual packages. And anyone on AskUbuntu will be able to help you since it is the standard/default version.
====
Quicker method:
sudo apt-get install lamp-server^
The ^ makes it install the task.
Best Answer
Are you developing using a GUI or not?
If you're developing on a computer where you need/want a GUI, such as Gnome/KDE, you'll need Ubuntu Desktop.
Ubuntu Server is the same as Ubuntu Desktop (even uses the same repository), but it doesn't have a GUI, and is a much more minimal install, with less overhead, primarily meant for computers that will be servers (e.g. a webserver).
Also, instead of downloading packages from sites, just use
apt-get
to install packages from the main repository. If needed, you can find other repositories with deb packages on launchpad.net, and add the repository (looks likeppa:abc/123
) with the commandadd-apt-repository
.