/GameMenu

A game menu utility that starts games in kiosk mode from TTY.

Primary LanguageGoGNU General Public License v3.0GPL-3.0

TUI Game Menu


Screenshot

A game menu utility written in Go, run under linux terminal/TTYs, starts games in kiosk mode. Joysticks can be used to navigate through the menu.

Compatibility

This program is designed for linux TTYs, though it may be able to be built and run on other platforms. Most joysticks should work.

Dependencies

The program itself can be executed without external C libraries. However, some external programs are required:

  • bash run scripts
  • systemd perform system controls like shutdown/reboot (by running systemctl)
  • cage execute GUI programs under wayland
  • xinit execute GUI programs under x11 (by running startx)

Profiles

Profiles are placed in ~/.config/gamemenu/{wayland/x11/misc}. They're basically shell scripts with specific functions.

# Tell the menu the entry's name.
name() {
  echo Example Entry
}

# programs to be executed. for wayland profiles they're executed by cage, for
# x11 profiles they're executed by startx, and for misc they're executed
# directly.
exec() {
  some-program <params> # setup resolution, etc
  some-game
}

# start functions by their names as parameter (name, exec)
$1

Environments

The program has no command line parameters, all configurations are set up with environment variables.

  • SHELL bash executable the program uses to run scripts. Usually already set to current shell. Retrieved by running which if not set.
  • SYSTEMCTL systemctl executable to control the system. Retrieved by running which if not set.
  • CAGE cage executable to start Wayland compositor. Retrieved by running which if not set.
  • STARTX startx script to start X server. Retrieved by running which if not set.
  • JOYSTICK legacy joystick device number (0 for /dev/input/js0). Defaults to 0 if not set.
  • EVDEV_JOYSTICK joystick device name (/dev/input/eventX). Automatically probed if not set.
  • GM_DEFAULT_TAB default selected tab on start, can be wayland/x11/misc. Defaults to wayland if not set.
  • GM_COLOR UI color. Can be RGB value in #rrggbb (requires terminals that support RGB), ANSI 256-color integer, or literal color names (black, red, etc., neon/neon_rgb for varying rainbow colors).