-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: switched from i3status + custom script to i3blocks, converted us…
…ing gptme
- Loading branch information
Showing
15 changed files
with
546 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
# Find the first available backlight device | ||
backlight_dir=$(find /sys/class/backlight -type d | head -n 1) | ||
|
||
if [ -n "$backlight_dir" ] && [ -f "$backlight_dir/max_brightness" ] && [ -f "$backlight_dir/brightness" ]; then | ||
max_brightness=$(cat "$backlight_dir/max_brightness") | ||
current_brightness=$(cat "$backlight_dir/brightness") | ||
if [ "$max_brightness" -ne 0 ]; then | ||
brightness_percent=$((current_brightness * 100 / max_brightness)) | ||
|
||
echo "🌞 ${brightness_percent}%" | ||
echo "🌞 ${brightness_percent}%" | ||
|
||
# Color calculation | ||
r=$((136 + (255 - 136) * brightness_percent / 100)) | ||
g=$((51 + (255 - 51) * brightness_percent / 100)) | ||
b=0 | ||
printf "#%02X%02X%02X\n" $r $g $b | ||
else | ||
echo "🌞 N/A" | ||
echo "🌞 N/A" | ||
echo "#FFFFFF" | ||
fi | ||
else | ||
echo "🌞 N/A" | ||
echo "🌞 N/A" | ||
echo "#FFFFFF" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Get the CPU Package temperature | ||
temp=$(sensors | awk '/^CPU Package:/ {print $3; exit}' | tr -d '+°C') | ||
|
||
if [ -n "$temp" ]; then | ||
temp=${temp%.*} # Remove decimal part | ||
echo "🌡️ ${temp}°C" | ||
echo "🌡️ ${temp}°C" | ||
|
||
# Color based on temperature | ||
if [ $temp -gt 80 ]; then | ||
echo "#FF0000" | ||
elif [ $temp -gt 60 ]; then | ||
echo "#FFFF00" | ||
else | ||
echo "#00FF00" | ||
fi | ||
else | ||
echo "🌡️ N/A" | ||
echo "🌡️ N/A" | ||
echo "#FFFFFF" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
# Read the first line of /proc/stat | ||
read cpu user nice system idle iowait irq softirq steal guest guest_nice <<< "$(grep '^cpu ' /proc/stat)" | ||
|
||
# Calculate the total CPU time | ||
total=$((user + nice + system + idle + iowait + irq + softirq + steal + guest + guest_nice)) | ||
|
||
# Calculate the CPU usage since we last checked | ||
if [[ -f /tmp/cpu_usage.prev ]]; then | ||
prev_total=$(< /tmp/cpu_usage.prev) | ||
prev_idle=$(< /tmp/cpu_idle.prev) | ||
diff_idle=$((idle - prev_idle)) | ||
diff_total=$((total - prev_total)) | ||
diff_usage=$((1000 * (diff_total - diff_idle) / diff_total + 5)) | ||
usage=$((diff_usage / 10)) | ||
else | ||
usage=0 | ||
fi | ||
|
||
# Save the current values for the next check | ||
echo "${total}" > /tmp/cpu_usage.prev | ||
echo "${idle}" > /tmp/cpu_idle.prev | ||
|
||
echo "🏭 ${usage}%" | ||
echo "🏭 ${usage}%" | ||
|
||
# Color calculation | ||
if [ $usage -ge 80 ]; then | ||
echo "#FF0000" | ||
elif [ $usage -ge 60 ]; then | ||
echo "#FFFF00" | ||
elif [ $usage -ge 40 ]; then | ||
echo "#FFFFFF" | ||
else | ||
echo "#00FF00" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Get disk usage for root partition | ||
disk_info=$(df -h / | awk '/\/$/ {print $4}') | ||
|
||
echo "💾 ${disk_info}" | ||
echo "💾 ${disk_info}" | ||
|
||
# Color is always white for disk usage | ||
echo "#FFFFFF" |
Oops, something went wrong.