Add sysinfo script

This commit is contained in:
Rob Watson 2021-04-06 20:25:06 +02:00
parent a636fefe97
commit 2bbcc0d690
2 changed files with 12 additions and 1 deletions

11
script/sysinfo Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
#
# Print loadavg to stdout
set -e
if [ $(uname -s) = "Darwin" ]; then
w | head -n1 | cut -d":" -f3
else # Linux
cut -d " " -f 1-3 /proc/loadavg
fi

View File

@ -9,7 +9,7 @@ set-window-option -g allow-rename off
set-option -g set-titles on set-option -g set-titles on
set -g status-style 'fg=white, bg=colour8' set -g status-style 'fg=white, bg=colour8'
set -g window-status-current-style 'fg=black, bg=green' set -g window-status-current-style 'fg=black, bg=green'
set -g status-right '#[fg=black, bg=colour2] #(cut -d " " -f 1-3 /proc/loadavg) #[default] #[fg=white, bg=colour238] %H:%M #[default]' set -g status-right '#[fg=black, bg=colour2] #(sysinfo) #[default] #[fg=white, bg=colour238] %H:%M #[default]'
set -g status-justify centre set -g status-justify centre
set-window-option -g mode-keys vi set-window-option -g mode-keys vi