Skip to content

Commit eac476f

Browse files
Merge pull request #149 from chauek/master
Added support for system temperature on Raspberry PI
2 parents 4bad7ad + 1426e08 commit eac476f

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul
3939
set -g @dracula-show-battery-status true
4040
```
4141
- If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature
42+
- System temperature on Raspberry PI
4243
- Info if the Panes are synchronized
4344
- Spotify playback (needs the tool spotify-tui installed). max-len can be configured.
4445
- Music Player Daemon status (needs the tool mpc installed)

scripts/dracula.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ main()
298298
continue
299299
fi
300300

301+
if [ $plugin = "rpi-temp" ]; then
302+
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-rpi-temp-colors" "green dark_gray")
303+
script="#($current_dir/rpi_temp.sh)"
304+
fi
305+
301306
if $show_powerline; then
302307
if $show_empty_plugins; then
303308
tmux set-option -ga status-right "#[fg=${!colors[0]},bg=${powerbg},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script "

scripts/rpi_temp.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
# setting the locale, some users have issues with different locales, this forces the correct one
3+
export LC_ALL=en_US.UTF-8
4+
5+
get_temp() {
6+
echo "$(vcgencmd measure_temp | sed 's/temp=//')"
7+
}
8+
9+
main() {
10+
# storing the refresh rate in the variable RATE, default is 5
11+
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
12+
echo "$(get_temp)"
13+
sleep $RATE
14+
}
15+
16+
# run main driver
17+
main

0 commit comments

Comments
 (0)