Skip to content

iahmadgad/termux-clock

Repository files navigation

Termux Clock

WIP GitLab: mirror Rust CI workflow Release workflow Lines of code Latest Tag Downloads PRs: welcome

Termux tool to set alarms & timers headlessly.

Requirements

Install

Important

both 2 methods install termux-api package not the Android app, which needs to be installed manually. Read Installation on termux/termux-api repo to know how to install the Android app.

Pre-built Termux packages

  • Navigate to GitHub 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:
apt install ./<package>.deb

From source

  • Install dependencies
pkg install termux-api at cronie
  • Compile and install from the latest commit on main branch:
cargo install --force --git https://github.com/iahmadgad/termux-clock
  • Or from tag (recommended):
cargo install --force --git https://github.com/iahmadgad/termux-clock --tag <tag>

See cargo-install(1) for more cargo install options.

Development

Requirements

Install just:

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:

just --list

List recipes in module:

just --list <module>

Just recipes are located in justfile and justmodules directory.

If you don't know just recipes read just documentation.

Manpages

Deb packages comes with manpages for termux-clock, termux-clock timer and termux-clock alarm

You can read them by running:

man termux-clock
man termux-clock-timer
man termux-clock-alarm

You can also build these manpages from source with man recipe:

just man

Or with build-man xtask (but ensure you are in the project root directory):

cargo build-man

Generated manpages are located in: target/manpages

Usage

timer

Option Description
-H, --hours <HOURS> add hours to timer length.
-M, --minutes <MINUTES> add minutes to timer length.
-S, --seconds <SECONDS> add seconds to timer length.
-m, --message <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

termux-clock timer -M 1 -S 30 -t -m "Timer for 1 minute and 30 seconds in Termux"

alarm

Option Description
-H, --hours <HOURS> alarm hour.
-M, --minutes <MINUTES> alarm extra minutes.
-d, --days <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 <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

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 📳"

About

>_ Termux tool to set alarms & timers headlessly.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published