Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Generic system temperature support #307

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +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
- System temperature on Raspberry PI and on regular computers
locnnil marked this conversation as resolved.
Show resolved Hide resolved
- 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
4 changes: 2 additions & 2 deletions scripts/dracula.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ main()
continue
fi

if [ $plugin = "rpi-temp" ]; then
if [ $plugin = "sys-temp" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-rpi-temp-colors" "green dark_gray")
locnnil marked this conversation as resolved.
Show resolved Hide resolved
script="#($current_dir/rpi_temp.sh)"
script="#($current_dir/sys_temp.sh)"
fi

if $show_powerline; then
Expand Down
8 changes: 7 additions & 1 deletion scripts/rpi_temp.sh → scripts/sys_temp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
export LC_ALL=en_US.UTF-8

get_temp() {
echo "$(vcgencmd measure_temp | sed 's/temp=//')"
if [[ -d "/proc/device-tree/" && -f "/proc/device-tree/model" && $(grep -i 'Raspberry' /proc/device-tree/model) ]]; then
# It's a Raspberry pi
echo "$(vcgencmd measure_temp | sed 's/temp=//')"
else
# It's a Regular pc
locnnil marked this conversation as resolved.
Show resolved Hide resolved
echo "$(sensors | grep 'Tctl' | awk '{print substr($2, 2)}')"
fi
}

main() {
Expand Down