ministo

A tmux status bar and scripts for CPU miners.
git clone git://git.swab.dev/ministo.git
Log | Files | Refs | README

commit c9017c4acb6b66d8fc4ca244490afd5f61525132
parent dfe6b914694f19458b386d394e3f913a4123b11f
Author: Jaron Swab <jaron@swab.dev>
Date:   Sat, 19 Jun 2021 22:09:35 -0400

Added readme and cpu temp script

Diffstat:
AREADME.md | 19+++++++++++++++++++
AgetAverageCpuTemp.sh | 29+++++++++++++++++++++++++++++
Mtmux.conf | 2+-
3 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -0,0 +1,19 @@ +# Ministo + +The CPU miner's vital information in the terminal. + +May be used in the tmux status bar or any other status bar which allows for scripts to be run. + +## Dependencies: +### Debian/Ubuntu/et. al. +```shell +# apt install sensors bc +``` +### Arch, Manjaro. et. al. +```shell +# pacman -S sensors bc +``` +### Artix Runing Open-RC +```shell +# pacman -S sensors sensors-openrc bc +``` diff --git a/getAverageCpuTemp.sh b/getAverageCpuTemp.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +hasCoreTemp=$(sensors | grep 'coretemp') +if [ ! "$hasCoreTemp" = "" ]; then + cpus=$(sensors | awk '/Core/ { print $3 }' | sed 's/\+//' | sed 's/°C//') + + n=0 + i=0 + sum=0 + + for _ in $cpus; do + n=$((n+1)) + done + + while [ $i -le $n ]; do + i=$((i+1)) + done + + for num in $cpus; do + sum=$(echo "$sum" + "$num" | bc -l) + done + + avgTemp="$(echo "$sum" / "$n" | bc -l)" + printf '%0.1f°C' "$avgTemp" + exit 0; +fi + +## Some AMD Ryzen CPUs report CPU tempurature with "Tdie" in `sensors` +sensors | awk '/Tdie:/ { print $2}' && exit 0; diff --git a/tmux.conf b/tmux.conf @@ -19,5 +19,5 @@ set-option -g status-left-length 25 set-option -g status-left "#[fg=white]#[bg=black]#H #[fg=white]#[bg=black]#(uname -r | cut -d "-" -f 1) #[default]" set-option -g status-right-length 150 -set-option -g status-right "#[fg=white]#[bg=black]#[fg=white]#[bg=black]CPU: #(sh $HOME/.config/tmux/getAverageCpuMHz.sh) #(sensors | awk '/Tdie:/ { print $2}') | " +set-option -g status-right "#[fg=white]#[bg=black]#[fg=white]#[bg=black]CPU: #(sh $HOME/.config/tmux/getAverageCpuMHz.sh) #(sh $HOME/.config/tmux/getAverageCpuTemp.sh) | " set-option -ag status-right "#[fg=white]#[bg=black]#[fg=white]#[bg=black]%a %Y-%m-%d %H:%M "