https://github.com/aalaqily/termux-clock
>_ Termux tool to set alarms & timers headlessly.
https://github.com/aalaqily/termux-clock
rootless termux termux-tool wip
Last synced: 2 days ago
JSON representation
>_ Termux tool to set alarms & timers headlessly.
- Host: GitHub
- URL: https://github.com/aalaqily/termux-clock
- Owner: aalaqily
- License: mit
- Created: 2024-09-29T12:48:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-15T10:48:49.000Z (about 1 year ago)
- Last Synced: 2025-03-12T15:18:01.496Z (11 months ago)
- Topics: rootless, termux, termux-tool, wip
- Language: Rust
- Homepage:
- Size: 163 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Termux Clock
[](#)
[](https://gitlab.com/aalaqily/termux-clock)
[](https://github.com/aalaqily/termux-clock/actions/workflows/rust.yml)
[](https://github.com/aalaqily/termux-clock/actions/workflows/release.yml)
[](#)
[](https://github.com/aalaqily/termux-clock/tags)
[)](https://github.com/aalaqily/termux-clock/releases)
[](https://github.com/aalaqily/termux-clock/fork)
Termux tool to set alarms & timers headlessly.
# Requirements
- [Termux](https://github.com/termux/termux-app) >= `0.118.1` _(this version solves issue termux/termux-app#3990)_
- [Termux: API](https://github.com/termux/termux-api)
- Termux packages: `termux-api`, `at`, `cronie`
# Install
> [!IMPORTANT]
> both 2 methods install `termux-api` package not the Android app, which needs to be installed manually.
> Read [Installation](https://github.com/termux/termux-api?tab=readme-ov-file#installation) on `termux/termux-api` repo to know how to install the Android app.
## Pre-built Termux packages
- Navigate to [GitHub Releases](https://github.com/aalaqily/termux-clock/releases), and choose package with your desired version & phone architecture (run `uname -m` in termux to know your phone's architecture).
- copy deb file url & download it using `wget` or `curl`.
- Install the downloaded package with `apt`:
```sh
apt install ./.deb
```
## From source
- Install dependencies
```sh
pkg install termux-api at cronie
```
- Compile and install from the latest commit on `main` branch:
```sh
cargo install --force --git https://github.com/aalaqily/termux-clock
```
- Or from tag (recommended):
```sh
cargo install --force --git https://github.com/aalaqily/termux-clock --tag
```
See [`cargo-install(1)`](https://doc.rust-lang.org/cargo/commands/cargo-install.html) for more `cargo install` options.
# Development
## Requirements
- [just](https://github.com/casey/just) >= `1.19.0` _(for modules feature)_
- [yq](https://github.com/mikefarah/yq)
- [cross](https://github.com/cross-rs/cross) _(in case you are not building on termux)_
- [termux-create-package](https://github.com/termux/termux-create-package)
- bash
Install just:
```sh
cargo install just
```
Other tools (except bash) will be installed automatically during build process, or when you use `install-tool` recipe.
The `install-tool` recipe is designed to run on an AMD64 Linux machine. If your system does not meet these requirements, it is recommended to install the tools manually.
## Just recipes
List recipes in `justfile`:
```sh
just --list
```
List recipes in module:
```sh
just --list
```
Just recipes are located in `justfile` and `justmodules` directory.
If you don't know just recipes read [just documentation](https://just.systems/man/en/).
# Manpages
Deb packages comes with manpages for `termux-clock`, `termux-clock timer` and `termux-clock alarm`
You can read them by running:
```sh
man termux-clock
man termux-clock-timer
man termux-clock-alarm
```
You can also build these manpages from source with `man` recipe:
```sh
just man
```
Or with `build-man` [xtask](https://github.com/matklad/cargo-xtask) (but ensure you are in the project root directory):
```sh
cargo build-man
```
Generated manpages are located in: `target/manpages`
# Usage
## `timer`
| Option | Description |
| ------ | ----------- |
| `-H, --hours ` | add hours to timer length. |
| `-M, --minutes ` | add minutes to timer length. |
| `-S, --seconds ` | add seconds to timer length. |
| `-m, --message ` | timer message. |
| `-v, --vibrate` | enable vibration. _(not available in android timers, so use it with `--termux` option)_. |
| `-t, --termux` | set timer in termux instead of android alarm clock. |
### Example
```sh
termux-clock timer -M 1 -S 30 -t -m "Timer for 1 minute and 30 seconds in Termux"
```
## `alarm`
| Option | Description |
| ------ | ----------- |
| `-H, --hour ` | alarm hour. |
| `-M, --minutes ` | alarm extra minutes. |
| `-d, --days ` | days to recurr the alarm, denoted by comma-seperated numbers (e. g. `1,2,3`), where each number corresponds to a weekday, starting from sunday (i. e. sunday is `1`, monday is `2` and so on and so forth). |
| `-m, --message ` | alarm message. |
| `-v, --vibrate` | enable vibration. |
| `-t, --termux` | set alarm in termux instead of android alarm clock. |
| `--pm` | set alarm hour in pm instead of am. |
### Example
```sh
termux-clock alarm -H 6 -M 30 -d 1,2,3 -v -m "Alarm at 06:30 am 🕡 every Sunday, Monday and Tuesday with vibration enabled 📳"
```