diff --git a/README.md b/README.md index bbae27c..8ee1a13 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index b523d19..14363b2 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -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 " diff --git a/scripts/rpi_temp.sh b/scripts/rpi_temp.sh new file mode 100755 index 0000000..25898c2 --- /dev/null +++ b/scripts/rpi_temp.sh @@ -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