App for AsteroidOS that provides an interface for running scripts on your watch.
script-shell lists scripts (executable files) in /home/ceres/script-shell
.
It then lets you run those scripts and displays some stdout messages and the state on the watch display.
First install the SDK: https://wiki.asteroidos.org/index.php/Installing_the_SDK
# build package
export CMAKE_PROGRAM_PATH=/usr/local/oecore-x86_64/sysroots/armv7vehf-neon-oe-linux-gnueabi/usr/bin/
source /usr/local/oecore-x86_64/environment-setup-armv7vehf-neon-oe-linux-gnueabi
cmake -B build
cmake --build build --target package
# install package
scp build/*.ipk root@192.168.2.15:.
ssh root@192.168.2.15 "opkg install script-shell*.ipk"
More about building AsteroidOS apps: https://wiki.asteroidos.org/index.php/Creating_an_Asteroid_app
script-shell scans and displays all executable files installed in /home/ceres/script-shell
.
Files must be executable (chmod 700 script.sh
). Else they will be ingored.
- Files will be sorted alphanumericly.
- Leading digits, followed by a
_
will not be displayed. - File-extensions (everything after the
.
) will be ommited too. -
and_
signs will be replaced by a space (
Example filename: 01_Hello-World.sh
#!/bin/sh
# Lines on stdout that beginn with a `->` are getting displayed on the watch.
# All other text output will be ignored.
echo "-> Hello World"
echo "ignored output"
# A return value of 0 indicatates success.
# All other return values are interpreted as error.
exit 0
See doc/example-scripts for some examples.