Installing GJS and Running The Examples
This guide is built for running the examples you will encounter in the first half of this guide, for setting up an application development environment go here;
Using The Command Line
Using the command line is possible but can be difficult if your distribution is not running a modern version of GJS by default. Beginning examples may function properly, while more advanced topics fail due to missing features. You can view a list of supported GJS features by version here.
Installing GJS
Install GJS from any of the packages below.
- Ubuntu 18.04
- Debian Stretch
- Arch Linux
- more at pkgs.orgopen in new window
Verifying Your GJS Version
Verify your system has a recent version of GJS. Type...
gjs --version
...into a terminal. You can see the features your version of GTK supports here. If your version is below 1.48.x it is recommended you use GNOME Builderopen in new window or build GJS from source.
Running A Tutorial
Open a new file and place the code you would like to run in a code viewer of your choosing.
Save the code to a file, file.js
.
Run this in terminal:
gjs file.js
The program output will appear in the terminal.