Want to contribute code to elementary OS itself? Here are some tips.
elementary-sdk from the Terminal:
sudo apt install elementary-sdk
This is a metapackage that depends on several tools we use for development.
dconf Editor is an invaluable tool for seeing and modifying settings. It's installed along with
The GTK Inspector is similar to a web browser's inspector, but for GTK apps. Using the Inspector can greatly speed up development, and allows you view and to test out changing properties without recompiling your app. You can also test out temporary in-app CSS.
First, make sure you have the
elementary-sdk installed. Then enable the Inspector keybinding:
gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true
Focus your app, then launch the Inspector by pressing Ctrl+Shift+I to inspect the widget beneath your cursor, or Ctrl+Shift+D to open the inspector without a widget selected.
You can also run it temporarily together with your app by running:
You can quickly install all known dependencies for a project with
sudo apt build-dep <packagename>
This installs the dependencies for the currently-released version, so it may miss dependencies for unreleased updates. In those cases, refer to the project's README.
You can audit your system for files that have been changed from their originally installed packages:
sudo apt install debsums sudo debsums_init
View changed files:
sudo debsums -cs
View which packages those files belong to:
sudo debsums -c | xargs -rd '\n' -- dpkg -S | cut -d : -f 1 | sort -u
Assuming that you've used
--prefix=/usr when installing custom version you can restore them using:
sudo apt install appname --reinstall
When developing the Panel (codenamed WingPanel) or panel-related packages like the Applications Menu and indicators, you want to start WingPanel from the command line to view logs. WingPanel is automatically started and restarted by Cerbere. To remove WingPanel from its monitored applications:
killall wingpanelto stop the current WingPanel
To restore normal behavior simply enable "Use default value" in dconf Editor. Cerbere will notice this and start to monitor WingPanel again.
Gala is the window manager of elementary OS. If it crashes or freezes during development, it can be nonobvious how to recover. Here's how to do it:
DISPLAY=:0 gala --replace &
If Gala doesn't start, you can reinstall the latest stable version by running
sudo apt install --reinstall gala.