tmuxstatus

Crates.iotmuxstatus
lib.rstmuxstatus
version1.1.0
sourcesrc
created_at2022-10-12 19:55:19.007793
updated_at2024-05-03 08:26:02.291911
descriptionGenerates tmux status line with CPU usage.
homepagehttps://www.bitpowder.com/apps/tmuxstatus.page
repositoryhttps://gitlab.com/bitpowder/indigo-ng
max_upload_size
id686649
size48,291
Bernard van Gastel (bvgastel)

documentation

README

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

Displays:

  • CPU utilization;
  • current memory usage;
  • battery charge;
  • on Linux: RAPL reading if available (might have to make powercap interface available sudo apt install sysfsutils; echo "mode class/powercap/intel-rapl:0/energy_uj = 0444" | sudo tee -a /etc/sysfs.d/intel-rapl-user-mode; sudo chmod -R a+r /sys/class/powercap/intel-rapl, warning: this can lead to security attacks on keys).

Example (using nerd-fonts):

 █████▇█████████████▇▇████▇▇▇▇█  8.679G  80%  2.214 mJ  08:01

Installation

cargo install tmuxstatus

Configuration

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

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

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

set -g status-right "#(tmuxstatus --timeout 1800 sudo systemctl suspend)  %H:%M "
set -g status-interval 1
set -g status-right-length "80"

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.

Commit count: 1279

cargo fmt