A small Heads-Up Display (HUD) to show some useful information at a glance, like the current time and weather. Designed for a small LCD screen attached to a Raspberry Pi that I have running at home. Some design principles I've followed:
- Fits on a 480×320 pixel screen.
- Easy to see the basic information from far away, meaning not too much information on a single screen.
- Not too many separate screens, as that prevents useful information from being visible more often.
For more information about the development process, see the following blog posts:
- Setting up an LCD screen on the Raspberry Pi, 2019 edition
- Writing GUI applications on the Raspberry Pi without a desktop environment
- Creating Raspberry Pi applications with Raylib and Ruby
- Creating Raspberry Pi applications with Raylib and Ruby - Part II
Despite running primarily on a Raspberry Pi, nothing about this project is specific to the platform.
-
Install Raylib. Build a shared library, instead of the default static library:
cd /path/to/raylib cd src make RAYLIB_LIBTYPE=SHARED
-
Install development dependencies. On Debian-based systems:
sudo apt install build-essential swig
-
Ensure you have a suitably new version of Ruby (3.x), along with its development headers needed to build native extensions. If you're using the system-wide Ruby installation on Debian-based systems:
sudo apt install ruby ruby-dev
I prefer using rbenv and ruby-build to manage my Ruby installations. This allows me to have multiple installations on the same system.
-
Build the Ruby extension:
# Install rake gem install bundler bundle # If Raylib is installed to standard location (with include + lib # subdirectories). Defaults to `/usr/local` if installed system-wide. bundle exec rake raylib RAYLIB_INSTALL_PATH=/path/to/raylib # If Raylib is installed to non-standard locations bundle exec rake raylib \ RAYLIB_HEADER_INSTALL_PATH=/path/to/raylib/header \ RAYLIB_LIB_INSTALL_PATH=/path/to/raylib/lib # If compiling on the Raspberry Pi, pass the `PLATFORM` flag. This flag # can be combined with the other flags from above. bundle exec rake raylib PLATFORM=PLATFORM_RPI
-
Register for the OpenWeatherMap API and obtain an App ID.
-
Run the HUD Ruby application, specifying the App ID as an environment variable:
OPEN_WEATHER_APPID='<app-id-from-above>' ./hud.rb
The intermediate files generated during the building of the extension can be cleaned up:
# To clean up all intermediate files, but leave the final extension library:
#
# rake clean
#
# To clean up all build artifacts, including the final extension library:
#
# rake clobber
- Homepage
- Rendered as fixed-size white PNGs
- Open Weather Icon is licenced under MIT
- Icons from Flaticon are under CC: Lucy G, Freepik, SimpleIcon, Robin Kylander, Darius Dan, AnhGreen
- Homepage
- Licensed under the Apache License, version 2.0