Skip to content

Commit

Permalink
Merge pull request #149 from chauek/master
Browse files Browse the repository at this point in the history
Added support for system temperature on Raspberry PI
  • Loading branch information
ethancedwards8 authored Oct 18, 2024
2 parents 4bad7ad + 1426e08 commit eac476f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul
set -g @dracula-show-battery-status true
```
- If forecast information is available, a ☀, ☁, ☂, or ❄ unicode character corresponding with the forecast is displayed alongside the temperature
- System temperature on Raspberry PI
- Info if the Panes are synchronized
- Spotify playback (needs the tool spotify-tui installed). max-len can be configured.
- Music Player Daemon status (needs the tool mpc installed)
Expand Down
5 changes: 5 additions & 0 deletions scripts/dracula.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ main()
continue
fi

if [ $plugin = "rpi-temp" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-rpi-temp-colors" "green dark_gray")
script="#($current_dir/rpi_temp.sh)"
fi

if $show_powerline; then
if $show_empty_plugins; then
tmux set-option -ga status-right "#[fg=${!colors[0]},bg=${powerbg},nobold,nounderscore,noitalics]${right_sep}#[fg=${!colors[1]},bg=${!colors[0]}] $script "
Expand Down
17 changes: 17 additions & 0 deletions scripts/rpi_temp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# setting the locale, some users have issues with different locales, this forces the correct one
export LC_ALL=en_US.UTF-8

get_temp() {
echo "$(vcgencmd measure_temp | sed 's/temp=//')"
}

main() {
# storing the refresh rate in the variable RATE, default is 5
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
echo "$(get_temp)"
sleep $RATE
}

# run main driver
main

0 comments on commit eac476f

Please sign in to comment.