diff --git a/companion_software/dashboard/Pipfile b/companion_software/dashboard/Pipfile new file mode 100644 index 0000000..71e4f7c --- /dev/null +++ b/companion_software/dashboard/Pipfile @@ -0,0 +1,11 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] + +[dev-packages] + +[requires] +python_version = "3.9" diff --git a/companion_software/dashboard/Pipfile.lock b/companion_software/dashboard/Pipfile.lock new file mode 100644 index 0000000..8aee7e8 --- /dev/null +++ b/companion_software/dashboard/Pipfile.lock @@ -0,0 +1,20 @@ +{ + "_meta": { + "hash": { + "sha256": "a36a5392bb1e8bbc06bfaa0761e52593cf2d83b486696bf54667ba8da616c839" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.9" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": {}, + "develop": {} +} diff --git a/companion_software/dashboard/dash.py b/companion_software/dashboard/dash.py new file mode 100644 index 0000000..5a5637d --- /dev/null +++ b/companion_software/dashboard/dash.py @@ -0,0 +1,33 @@ +# Draw text to center of screen +import curses + +screen = curses.initscr() +num_rows, num_cols = screen.getmaxyx() + + +# Make a function to print a line in the center of screen +def print_center(message): + # Calculate center row + middle_row = int(num_rows / 2) + + # Calculate center column, and then adjust starting position based + # on the length of the message + half_length_of_message = int(len(message) / 2) + middle_column = int(num_cols / 2) + x_position = middle_column - half_length_of_message + + # Draw the text + screen.addstr(middle_row, x_position, message) + screen.refresh() + + +print_center("Greatness awaits...") + +# Wait and cleanup +while True: + try: + curses.napms(500) + except KeyboardInterrupt: + break + +curses.endwin() diff --git a/companion_software/dashboard/entrypoint.sh b/companion_software/dashboard/entrypoint.sh new file mode 100755 index 0000000..60d09de --- /dev/null +++ b/companion_software/dashboard/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +pipenv install -r requirements.txt + +pipenv run python dash.py diff --git a/companion_software/dashboard/requirements.txt b/companion_software/dashboard/requirements.txt new file mode 100644 index 0000000..e69de29