Skip to content

Commit 51c1744

Browse files
committed
boring: new gtk-based weather and time display demo
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
1 parent bfbcd0c commit 51c1744

17 files changed

Lines changed: 1859 additions & 0 deletions

.github/workflows/build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,42 @@ jobs:
9292
labels: ${{ steps.meta.outputs.labels }}
9393
cache-from: type=gha
9494
cache-to: type=gha,mode=max
95+
96+
build-boring-docker:
97+
runs-on: ubuntu-latest
98+
permissions:
99+
contents: read
100+
packages: write
101+
102+
steps:
103+
- uses: actions/checkout@v4
104+
105+
- name: Set up QEMU
106+
uses: docker/setup-qemu-action@v3
107+
108+
- name: Set up Docker Buildx
109+
uses: docker/setup-buildx-action@v3
110+
111+
- name: Log in to Container Registry
112+
uses: docker/login-action@v3
113+
with:
114+
registry: ${{ env.REGISTRY }}
115+
username: ${{ github.actor }}
116+
password: ${{ secrets.GITHUB_TOKEN }}
117+
118+
- name: Extract metadata
119+
id: meta
120+
uses: docker/metadata-action@v5
121+
with:
122+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-boring
123+
tags: |
124+
type=raw,value=latest
125+
type=sha,prefix={{branch}}-
126+
127+
- name: Build and push Docker image
128+
uses: docker/build-push-action@v5
129+
with:
130+
context: ./boring
95131
platforms: linux/amd64,linux/arm64
96132
push: true
97133
tags: ${{ steps.meta.outputs.tags }}
@@ -130,6 +166,7 @@ jobs:
130166
131167
**Docker images:**
132168
- `ghcr.io/${{ github.repository }}:latest` (classic demo)
169+
- `ghcr.io/${{ github.repository }}-boring:latest` (boring weather display)
133170
134171
Built from commit: ${{ github.sha }}
135172
artifacts: "artifacts/**/*.AppImage"

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SUBDIRS = classic boring
2+
3+
all clean:
4+
@for dir in $(SUBDIRS); do \
5+
if [ -d "$$dir" ]; then \
6+
$(MAKE) -C $$dir $@ || exit 1; \
7+
fi; \
8+
done
9+
10+
.PHONY: all clean

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Infix Demo Collection
2+
3+
Two demo applications for trade shows, exhibitions, and kiosk displays.
4+
5+
## Demos
6+
7+
### [Classic](classic/README.md) -- Oldschool Demoscene
8+
9+
A classic demoscene-style demo with multiple visual effects, text scrollers,
10+
and tracker music. Built with SDL2 and inspired by 1990s Amiga/PC demos.
11+
12+
### [Boring](boring/README.md) -- Weather & Time Display
13+
14+
A GTK-based weather and time display with animated backgrounds. Touch
15+
anywhere to temporarily show a configurable web page (e.g., a dashboard),
16+
then automatically return to the weather view.
17+
18+
## Quick Start
19+
20+
```bash
21+
# Build everything
22+
make
23+
24+
# Or build individually
25+
make -C classic
26+
make -C boring
27+
28+
# Run with Docker Compose
29+
docker compose up classic
30+
docker compose up boring
31+
```
32+
33+
## License
34+
35+
MIT License -- See [LICENSE](LICENSE) for details.

boring/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
boring

boring/Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Build stage
2+
FROM debian:bookworm-slim AS builder
3+
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
gcc \
6+
make \
7+
pkg-config \
8+
libgtk-3-dev \
9+
libwebkit2gtk-4.1-dev \
10+
libsoup-3.0-dev \
11+
libcjson-dev \
12+
&& rm -rf /var/lib/apt/lists/*
13+
14+
WORKDIR /build
15+
16+
COPY boring.c weather.c weather.h animations.c animations.h \
17+
sunriset.c sunriset.h Makefile ./
18+
19+
RUN make
20+
21+
# Runtime stage
22+
FROM debian:bookworm-slim
23+
24+
RUN apt-get update && apt-get install -y --no-install-recommends \
25+
libgtk-3-0 \
26+
libwebkit2gtk-4.1-0 \
27+
libsoup-3.0-0 \
28+
libcjson1 \
29+
ca-certificates \
30+
xorg \
31+
xinit \
32+
dbus-x11 \
33+
x11-xserver-utils \
34+
&& rm -rf /var/lib/apt/lists/*
35+
36+
WORKDIR /app
37+
38+
COPY --from=builder /build/boring .
39+
COPY xorg.conf /etc/X11/xorg.conf
40+
COPY start.sh /app/start.sh
41+
42+
ENV DISPLAY=:0
43+
44+
CMD ["/app/start.sh", "-f"]

boring/Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
gtk_CFLAGS = $(shell pkg-config --cflags gtk+-3.0 webkit2gtk-4.1 libsoup-3.0 libcjson)
2+
gtk_LIBS = $(shell pkg-config --libs gtk+-3.0 webkit2gtk-4.1 libsoup-3.0 libcjson)
3+
4+
CFLAGS = $(gtk_CFLAGS) -DSUNRISET_LIB -Wall -O2
5+
LDLIBS = $(gtk_LIBS) -lm
6+
7+
TARGET = boring
8+
SOURCES = boring.c weather.c animations.c sunriset.c
9+
10+
all: $(TARGET)
11+
12+
$(TARGET): $(SOURCES) weather.h animations.h sunriset.h
13+
$(CC) $(CFLAGS) -o $(TARGET) $(SOURCES) $(LDLIBS)
14+
15+
run: $(TARGET)
16+
./$(TARGET)
17+
18+
clean:
19+
rm -f $(TARGET)
20+
21+
docker-build:
22+
docker build -t demo-boring .
23+
24+
docker-run: docker-build
25+
xhost +local:docker
26+
docker run -it --rm \
27+
-e DISPLAY=$(DISPLAY) \
28+
-v /tmp/.X11-unix:/tmp/.X11-unix \
29+
demo-boring
30+
31+
.PHONY: all clean run docker-build docker-run

boring/README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Boring -- Weather & Time Display
2+
3+
A GTK-based weather and time display with animated Cairo backgrounds.
4+
Touch anywhere to temporarily show a configurable web page (e.g., a
5+
dashboard), then automatically return to the weather view after 30
6+
seconds.
7+
8+
## Features
9+
10+
- Live weather from [Open-Meteo](https://open-meteo.com/) (no API key needed)
11+
- Animated backgrounds: sky gradient, sun, clouds, rain, snow
12+
- Sunrise/sunset times
13+
- Touch/click to show a web page (WebKitGTK), auto-returns after 30s
14+
- Fullscreen kiosk mode
15+
16+
## Quick Start
17+
18+
### Build and Run
19+
20+
```bash
21+
sudo apt install libgtk-3-dev libwebkit2gtk-4.1-dev libsoup-3.0-dev libcjson-dev
22+
make
23+
./boring --lat 59.33 --lon 18.07 -f
24+
```
25+
26+
### Run with Docker
27+
28+
```bash
29+
docker compose up boring
30+
```
31+
32+
Or standalone:
33+
34+
```bash
35+
docker run --rm -it \
36+
--privileged \
37+
-v /dev/fb0:/dev/fb0 \
38+
-v /dev/tty1:/dev/tty1 \
39+
-e LATITUDE=59.33 \
40+
-e LONGITUDE=18.07 \
41+
-e WEB_URL=https://example.com \
42+
ghcr.io/kernelkit/demo-boring:latest
43+
```
44+
45+
## Command-Line Options
46+
47+
```
48+
Usage: boring [OPTIONS]
49+
50+
-f, --fullscreen Run in fullscreen mode
51+
--lat LATITUDE Latitude for weather (default: 59.3293)
52+
--lon LONGITUDE Longitude for weather (default: 18.0686)
53+
--url URL Web page URL shown on touch/click
54+
```
55+
56+
Environment variables `LATITUDE`, `LONGITUDE`, and `WEB_URL` are used
57+
as fallbacks when command-line options are not given.
58+
59+
## Dependencies
60+
61+
| Library | Package (Debian/Ubuntu) | Purpose |
62+
|----------------|----------------------------|----------------------|
63+
| GTK 3 | `libgtk-3-dev` | GUI framework |
64+
| WebKitGTK 4.1 | `libwebkit2gtk-4.1-dev` | Embedded web view |
65+
| libsoup 3.0 | `libsoup-3.0-dev` | HTTP client |
66+
| cJSON | `libcjson-dev` | JSON parsing |
67+
68+
## Vendored Code
69+
70+
The following files are vendored (copied into this repository) to avoid
71+
external build-time dependencies on libraries not commonly packaged:
72+
73+
| Files | Origin | License |
74+
|--------------------------|------------------------------------------------------------------------|--------------|
75+
| `sunriset.c`, `sunriset.h` | [troglobit/sun](https://github.com/troglobit/sun) by Paul Schlyter | Public domain |
76+
77+
Originally written as DAYLEN.C (1989) by Paul Schlyter, modified to
78+
SUNRISET.C (1992), split into header by Joachim Nilsson (2017).
79+
Released to the public domain by Paul Schlyter, December 1992.
80+
81+
## License
82+
83+
MIT License -- See [../LICENSE](../LICENSE) for details.

0 commit comments

Comments
 (0)