spacetray is a status icon for showing the door status of your local hackerspace using the SpaceAPI.
  • C 94.6%
  • C++ 5.1%
  • CMake 0.3%
Find a file
2026-07-17 14:03:06 +02:00
bin First steps to move from Make to CMake. 2023-11-02 02:05:55 +01:00
themes Converted project to CPP and use Qt instead of Gtk. 2026-07-16 00:44:52 +02:00
.gitignore Converted project to CPP and use Qt instead of Gtk. 2026-07-16 00:44:52 +02:00
CMakeLists.txt Converted project to CPP and use Qt instead of Gtk. 2026-07-16 00:44:52 +02:00
LICENSE Started migration to Python... Maybe not a good idea. 2023-11-01 21:33:35 +01:00
main.cpp Converted project to CPP and use Qt instead of Gtk. 2026-07-16 00:44:52 +02:00
README.md Added screenshot. 2026-07-17 14:03:06 +02:00
shot.png Added screenshot. 2026-07-17 14:03:06 +02:00
spacetray.cpp Converted project to CPP and use Qt instead of Gtk. 2026-07-16 00:44:52 +02:00
spacetray.h Converted project to CPP and use Qt instead of Gtk. 2026-07-16 00:44:52 +02:00

spacetray

A panel Applet using Qt5 for showing the Status of a Hackerspace. Compatible with the SpaceAPI version >= 0.13.

spacetray

Status Icon "lock" colors:

  • Red = Door open
  • Green = Door closed

Installation:

Requirements:

  • Standard tools like g++, cmake, etc.
  • Qt5 (Widgets and Network modules)

Use the following command for getting the sources:

git clone https://github.com/hanez/spacetray.git

Change into the new directory:

cd spacetray

To compile the sources, run:

mkdir build
cd build
cmake ..
make

This will compile spacetray with status icon and notification support.

Just copy "bin/spacetray" to a folder in your $PATH. I do:

cp ./bin/spacetray ~/bin/

You can copy the file to /usr/bin to make it available to all users but I don't. If you want that just run:

sudo cp ./bin/spacetray /usr/bin/

Configuration:

Configuration is done via command line arguments.

Usage:

Run spacetray with:

./bin/spacetray <statusurl> &

Or if in your $PATH:

spacetray <statusurl>

Themes:

You can create your own icon theme by generating a C++ header file containing the icons as raw RGBA8888 pixel data in a static const quint8 array.

The format should look like this:

static const quint8 icon_open_data[] = {
  0xRR, 0xGG, 0xBB, 0xAA, ...
};

static const quint8 icon_closed_data[] = {
  0xRR, 0xGG, 0xBB, 0xAA, ...
};

The image size used in the default theme is 52x48 pixels with four channels (RGBA).

To create these arrays from a PNG image, you can use ImageMagick to convert the image to raw RGBA data and then format it into a C++ header.

Example using magick (ImageMagick 7):

magick icon_open.png -size 52x48 -depth 8 RGBA:icon_open.raw
hexdump -v -e '12/1 "0x%02x, " "\n"' icon_open.raw

Or using a simple one-liner to generate the header content:

echo "static const quint8 icon_open_data[] = {" > themes/my_theme.h
magick icon_open.png -size 52x48 -depth 8 RGBA:- | hexdump -v -e '12/1 "0x%02x, " "\n"' >> themes/my_theme.h
echo "};" >> themes/my_theme.h

Repeat the process for icon_closed_data and append it to the same header file.

You can then use your custom icon theme by changing the line:

#include "themes/lock.h"

to:

#include "themes/THEME_NAME.h"

in:

./spacetray.cpp