feat(games): add Snake and Tetris X11 games with menu integration

Add two standalone X11 games (not DWM plugins) for the Nokia 8110 keypad:
- src/games/snake.cpp: Nokia Snake II-style game, 240x296, built-in 5x7 font
- src/games/tetris.cpp: Tetris with next-piece preview, levels, line clears

Both float as dialog windows in dwm, use a self-contained bitmap font (no
font-file dependency), and are controlled via the numeric keypad (2/4/6/8
directions, 5 action) with arrow-key fallbacks.

- scripts/build-games.sh: Docker armv7 cross-compile (mirrors build-sxmo-x11.sh)
- overlay/rootfs/usr/share/sxmo/default_hooks/sxmo_hook_games.sh: Games menu hook
- overlay/rootfs/usr/bin/sxmo_appmenu.sh: add 'Games' entry after 'Apps' and a
  games submenu case

Binaries committed to prebuilt/games and overlay/rootfs/usr/bin per repo
convention. Deployed and verified on the live device (window maps, dwm focuses
it, keypad input reaches the game).
This commit is contained in:
Luxferre
2026-10-23 14:29:48 +03:00
parent 3f37e4efa1
commit 5f467b02fa
9 changed files with 936 additions and 1 deletions
+6 -1
View File
@@ -6,7 +6,7 @@ if [ "${1:-}" = "--fallback" ]; then
shift
elif [ -p /tmp/dwm_plugin_dmenu.fifo ]; then
case "${1:-}" in
""|sys|applications|scripts|modem|config|power|sthotkeys)
""|sys|applications|scripts|modem|config|power|games|sthotkeys)
exec dmenu "${1:-ctx}"
;;
esac
@@ -162,6 +162,7 @@ fast_sys_choices() {
fi
CHOICES="$icon_trm Terminal^0^st -e ${SHELL:-/bin/sh}
$icon_grd Apps^0^sxmo_appmenu.sh applications
$icon_gam Games^0^sxmo_appmenu.sh games
$icon_grd Scripts^0^sxmo_appmenu.sh scripts
$icon_dir Files^0^xfiles
$icon_phn Dialer^0^xdialer
@@ -191,6 +192,10 @@ getprogchoices() {
CHOICES="$(sxmo_hook_apps.sh)"
fi
;;
games)
WINNAME="Games"
CHOICES="$(sxmo_hook_games.sh)"
;;
scripts)
WINNAME="Scripts"
if [ -s "${XDG_RUNTIME_DIR:-/tmp}/sxmo_scripts.cache" ]; then