mirror of
https://github.com/Manoj-HV30/i3wm-ubuntu-dotfiles.git
synced 2026-05-16 19:35:23 +00:00
27 lines
482 B
Bash
Executable File
27 lines
482 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Get first CPU core temperature
|
|
TEMP=$(sensors | awk '/Core 0/ {print $3}' | tr -d '+°C')
|
|
|
|
# If temperature cannot be read
|
|
if [ -z "$TEMP" ]; then
|
|
echo "🌡 N/A"
|
|
exit 0
|
|
fi
|
|
|
|
# Convert to integer (truncate decimal)
|
|
TEMP_INT=${TEMP%.*}
|
|
|
|
# Color-coded emojis for cyberpunk style
|
|
if [ "$TEMP_INT" -lt 50 ]; then
|
|
EMOJI="🟢"
|
|
elif [ "$TEMP_INT" -lt 70 ]; then
|
|
EMOJI="🟡"
|
|
else
|
|
EMOJI="🔴"
|
|
fi
|
|
|
|
# Output with some flair
|
|
echo "$EMOJI $TEMP°C"
|
|
|