Skip to content

Instantly share code, notes, and snippets.

@rcarmo rcarmo/.tmux.conf
Last active Aug 21, 2019

Embed
What would you like to do?
Raspberry Pi tmux status bar
set-option -g status-right "#(/home/pi/status.sh) %H:%M %d-%b-%y"
#!/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
You can’t perform that action at this time.