3 releases (stable)

1.1.0 May 3, 2024
1.0.1 Dec 10, 2023
1.0.0 Mar 25, 2023
0.1.3 Oct 12, 2022

#997 in Command line utilities

Apache-2.0

560KB
12K SLoC

tmuxstatus

Displays a tmux status line with the CPU utilization for the last 20 seconds, and the current memory usage. Daemon stops after 5 minutes (by default). On stop, can execute an user specified command, e.g. to suspend the computer.s

Example (using nerd-fonts):

 █████▇█████████████▇▇████▇▇▇▇█  56629M  08:01

Installation

cargo install tmuxstatus

Configuration

Add the following to your ~/.tmux.conf:

set -g status-interval 1
set -g status-right "#(tmuxstatus)  %H:%M "
set -g status-right-length "60"

To auto suspend after 5 minutes, use the following command:

set -g status-right "#(tmuxstatus --timeout 300 sudo systemctl suspend)  %H:%M "

Working

Creates a daemon on first use to avoid overhead. New invocations query this daemon so the overhead is reduced.

The overhead can be further reduced if tmux supports directly reading a status line using UNIX domain sockets instead of spawning a process.

Dependencies

~18–28MB
~522K SLoC