Skip to content

Instantly share code, notes, and snippets.


Andrei matzipan

View GitHub Profile
matzipan /
Last active Mar 10, 2020
Getting Gala to run with Wayland

If you're interested in helping with this, join us on IRC: #elementary-dev on

Prerequisite: install the xwayland package.

I managed to get Gala to run in a VT with:

dbus-run-session -- gala --display-server --wayland

It even works with just gala --display-server --wayland, but the session still doesn't start.

matzipan /
Last active Jul 5, 2021
Vala, GLib and GTK+ cheatsheet

Building with debug symbols with cmake

cmake -DCMAKE_BUILD_TYPE=Debug .. should do the trick of building the binaries and including the debug symbols.

Enable debug messages

Set the following environment variable G_MESSAGES_DEBUG=all. This will allow you to see messages you print with debug in Vala.

Markup escaping


Keybase proof

I hereby claim:

  • I am matzipan on github.
  • I am matzipan ( on keybase.
  • I have a public key whose fingerprint is A097 394B 1430 335F CD2A 11E6 FB8D EECC BD87 E38E

To claim this, I am signing this object:

matzipan /
Last active Apr 7, 2016
Generate a hash color for an arbitrary input string with Vala

As elementary OS is going to add letter tiles (similar to Android's) to act as default avatars for contacts, there was discussion about the color allocation algorithm. As some of the proposals were about using a boring lookup tables, I decided to try my hand at some hashing and color format conversion.

The algorithm generates a 32 bit hash and squashes it in the [0, 1] interval by dividing it with uint32.MAX. This hash value then gets multiplied with 2*PI and used as the hue component of HSL. This gets converted back to RGB for further manipulation.

matzipan /
Last active Aug 29, 2015
Node.js Raspberry Pi clock source
  1. First, you need to install node.js and npm using the following command.
sudo apt-get install nodejs npm node-semver
  1. Second, you need to install the wiring-pi package.
npm install wiring-pi
matzipan / wave.ino
Created Jan 19, 2015
Arduino Christmas rainbow lights
View wave.ino
#include "FastLED.h"
#define DATA_PIN 3
#define CLOCK_PIN 13
#define kMatrixWidth 150
#define kMatrixHeight 1
#define NUM_LEDS (kMatrixWidth * kMatrixHeight)
CRGB leds[kMatrixWidth * kMatrixHeight];