Last active
April 17, 2021 23:01
-
-
Save rcarmo/e7a7cd1e099ac1f32b2329b7f1d0965d to your computer and use it in GitHub Desktop.
Raspberry Pi tmux status bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-option -g status-right "#(/home/pi/status.sh) %H:%M %d-%b-%y" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
UNDERVOLTED=0x1 | |
CAPPED=0x2 | |
THROTTLED=0x4 | |
SOFT_TEMPLIMIT=0x8 | |
HAS_UNDERVOLTED=0x10000 | |
HAS_CAPPED=0x20000 | |
HAS_THROTTLED=0x40000 | |
HAS_SOFT_TEMPLIMIT=0x80000 | |
STATUS=$(vcgencmd get_throttled) | |
STATUS=${STATUS#*=} | |
((($STATUS&UNDERVOLTED)!=0)) && echo -n "⚡️" | |
((($STATUS&THROTTLED)!=0)) && echo -n "🐌" | |
((($STATUS&CAPPED)!=0)) && echo -n "🚩" | |
((($STATUS&SOFT_TEMPLIMIT)!=0)) && echo -n "🌡" | |
STATUS=$(vcgencmd measure_clock arm) | |
STATUS=${STATUS#*=} | |
echo -n " $(($STATUS/1000000))MHz" | |
STATUS=$(vcgencmd measure_temp) | |
STATUS=${STATUS#*=} | |
echo -n " $STATUS" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment