How to hack the budgie desktop on ubuntu

Often the hardest part for budding new developers is how to start. So here are a few notes I made on how to start changing code in budgie-desktop itself.

Make sure your package management system is up-to-date and install the dev scripts

sudo apt update
sudo apt install devscripts

now run to enable the source code files from the repo:

software-properties-gtk

Click on the “Source code” checkbox
Click Close, Reload

Install all the development package dependencies:

sudo apt build-dep budgie-desktop

To get the current package source code (no need for root access from now on):

apt-get source budgie-desktop
cd budgie*

To compile first setup your build environment:

mkdir build
cd build
meson --prefix=/usr --libdir=/usr/lib -Dwith-gnome-screensaver=true
ninja -v

To install, make sure you are in the build folder you created previously:

sudo ninja install

Make changes in the .vala files, then recompile in the build folder (hint use two tilix windows - one for building, one for editing code:

ninja

If there are no compilation issues, install the compiled code:

sudo ninja install

After installation, you can use:

budgie-panel --replace &

or

budgie-wm --replace &

to restart the panel or window manager and see your glorious new code take effect (depending if you are changing in the panel or window-manager)

4 Likes

Hi! One question please: Is there any way to debug it? For example, echos to the shell. Thanks in advance!

It is kind of old fashioned - but one way is to use stderr.printf("this is the value of an integer variable %d and this is the value of a string %s", integer variable, string_variable); type statements that appear in the terminal when the code module is being executed - you’ll see them when running budgie-panel --replace & in the terminal

This was very useful, thank you.
I was trying to figure out how to change do behavior of some Budgie applets, and this was exactly what I needed. There’s just one that is bugging me. How would I go about adding a new applet to the build?

Some thoughts here how to get started with applet development

This write up is perfect btw, I had not even realized that it was you who wrote it! Definitely helped me make the modifications and eventual PR to your fork!

Thanks @fossfreedom for this. And thank you @rbreaves from bringing back this topic from the dead.

I managed to tinker slightly into the code and made a two line change (while not being able to code at all myself), so that now raven appears on the left when the applet is on a left panel set to autohide. Even the icon arrows are in the correct direction (right by default and left when open). This was something I wanted instead of having to go all the way to the right!

For anyone interested:

in src/panel/manager.vala (search for raven_screen = area.area;)
Change:

 if (left != null & right == null) {
            if (this.is_panel_huggable(left)) {
                /* Hug left */
                raven.screen_edge = Gtk.PositionType.LEFT;
                raven_screen.x += left.intended_size;
            } else {
                /* Stick right */
                raven.screen_edge = Gtk.PositionType.RIGHT;

To

if (left != null & right == null) {
            if (this.is_panel_huggable(left)) {
                /* Hug left */
                raven.screen_edge = Gtk.PositionType.LEFT;
                raven_screen.x += left.intended_size;
            } else {
                /* Still left */
                raven.screen_edge = Gtk.PositionType.LEFT;
                raven_screen.x += left.intended_size;

I suppose it could be summarized into one, but I’m lazy.

1 Like

@mezcalbert If you want to submit a PR to them here’s the link to their fork!

I am very glad to see them making good use of github for this project, makes contributing, at least for me so much easier than if I had to deal with email chains or whatever it is they do on the linux kernel and other older projects lol.