https://github.com/lilydjwg/accurate-time
Show accurate time in tmux status
https://github.com/lilydjwg/accurate-time
rust-cli tmux tmux-conf
Last synced: about 1 year ago
JSON representation
Show accurate time in tmux status
- Host: GitHub
- URL: https://github.com/lilydjwg/accurate-time
- Owner: lilydjwg
- License: bsd-3-clause
- Created: 2022-08-10T10:06:27.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-25T09:34:21.000Z (almost 2 years ago)
- Last Synced: 2025-03-20T21:21:17.658Z (about 1 year ago)
- Topics: rust-cli, tmux, tmux-conf
- Language: Rust
- Homepage:
- Size: 15.6 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Introduction
Show accurate time in tmux status, i.e. update exactly on every second change.
This resolves the issue when you have multiple such time statuses in sight,
they update in a randam order: even different sessions of the same tmux
instance update at different time!
In addition, this program reads the system load for tmux and color it so you
can tell if the system is overloaded at a glance.
## Installation and Configuration
Compile it like other Rust programs (install cargo first if you haven't yet):
```sh
cargo build --release
```
and put the built `target/release/accurate-time` to one of you `$PATH` directories.
You can use the following in your `~/.tmux.conf` to fallback if accurate-time isn't available:
```
if-shell "accurate-time tmux" {
set -g status-interval 0
} {
set -g status-interval 1
set -g status-right "#[fg=red]#(awk '{print $1, $2, $3}' /proc/loadavg) #[fg=colour15]%Y-%m-%d %H:%M:%S"
}
```
Note that accurate-time only updates `status-right`, so you need to configure other parts elsewhere.