Skip to content

Commit ea1a45d

Browse files
Merge pull request #307 from locnnil/sys-temp-support
add: Generic system temperature support
2 parents 80c1516 + 8efdc95 commit ea1a45d

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

README.md

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

scripts/dracula.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ main()
304304
continue
305305
fi
306306

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

312312
if $show_powerline; then

scripts/rpi_temp.sh renamed to scripts/sys_temp.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
export LC_ALL=en_US.UTF-8
44

55
get_temp() {
6-
echo "$(vcgencmd measure_temp | sed 's/temp=//')"
6+
if grep -q "Raspberry" /proc/device-tree/model 2>/dev/null; then
7+
# It's a Raspberry pi
8+
echo "$(vcgencmd measure_temp | sed 's/temp=//')"
9+
else
10+
echo "$(sensors | grep 'Tctl' | awk '{print substr($2, 2)}')"
11+
fi
712
}
813

914
main() {

0 commit comments

Comments
 (0)