https://github.com/bailuk/script-shell
App for AsteroidOS that provides an interface for running scripts on your watch
https://github.com/bailuk/script-shell
Last synced: about 1 month ago
JSON representation
App for AsteroidOS that provides an interface for running scripts on your watch
- Host: GitHub
- URL: https://github.com/bailuk/script-shell
- Owner: bailuk
- License: gpl-3.0
- Created: 2025-02-21T21:19:30.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-10-17T19:51:23.000Z (9 months ago)
- Last Synced: 2025-10-18T21:43:22.159Z (9 months ago)
- Language: C++
- Size: 365 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# script-shell
App for [AsteroidOS](https://asteroidos.org/) 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.


## Build and install
First install the SDK: https://wiki.asteroidos.org/index.php/Installing_the_SDK
```bash
# 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 -DCMAKE_INSTALL_PREFIX:PATH=/usr
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
## Conventions for scripts
**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.
### File name
1. Files will be sorted alphanumericly.
2. Leading digits, followed by a `_` will not be displayed.
3. File-extensions (everything after the `.`) will be ommited too.
4. `-` and `_` signs will be replaced by a space (` `).
Example filename: `01_Hello-World.sh`
### Example script
```bash
#!/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
```
### More examples
See [doc/example-scripts](doc/example-scripts) for some examples.