Automated weekly update

This commit is contained in:
klein panic
2024-08-13 23:44:23 -04:00
parent a531408be4
commit bcbadf2114
4 changed files with 16 additions and 20 deletions

View File

@@ -32,7 +32,7 @@ for pkg in "${requires_packages[@]}"; do
echo "Package $pkg is installed already. YAY" echo "Package $pkg is installed already. YAY"
fi fi
done done
sudo chmod +x /home/klein/KleinWindowManagement/customstatusbar/statusbars/statusbar.sh
sudo cp /home/klein/KleinWindowManagement/customstatusbar/statusbars/statusbar.sh /usr/bin/ sudo cp /home/klein/KleinWindowManagement/customstatusbar/statusbars/statusbar.sh /usr/bin/
echo "Installation done. Run statusbar.sh in shell" echo "Installation done. Run statusbar.sh in shell"

0
customstatusbar/statusbars/oldstatus2dbar.sh Executable file → Normal file
View File

View File

@@ -40,7 +40,7 @@ cpu() {
local status_line="" local status_line=""
status_line+="^c${grey}^^r${base_x},${base_y},${bar_width},${max_height}^" status_line+="^c${grey}^^r${base_x},${base_y},${bar_width},${max_height}^"
status_line+="^c${color}^^r${base_x},${usage_y},${bar_width},${usage_height}^" status_line+="^c${color}^^r${base_x},${usage_y},${bar_width},${usage_height}^"
status_line+="^d^^f5^" status_line+="^d^^f7^"
local topcon=$( ps -eo %cpu,comm --sort=-%cpu | head -n 2 | tail -n 1 | awk '{print $2}') local topcon=$( ps -eo %cpu,comm --sort=-%cpu | head -n 2 | tail -n 1 | awk '{print $2}')
topcon="${topcon:0:5}" # trunkate output topcon="${topcon:0:5}" # trunkate output
echo "{CPU:${status_line}${usage}% : ${topcon}}" echo "{CPU:${status_line}${usage}% : ${topcon}}"
@@ -56,7 +56,7 @@ ram() {
local status_line="" local status_line=""
status_line+="^c$grey^^r$base_x,${base_y},${bar_width},${max_height}^" status_line+="^c$grey^^r$base_x,${base_y},${bar_width},${max_height}^"
status_line+="^c$white^^r${base_x},${usage_y},${bar_width},${usage_height}^" status_line+="^c$white^^r${base_x},${usage_y},${bar_width},${usage_height}^"
status_line+="^d^^f5^" status_line+="^d^^f7^"
status_line+="${p_mem}%" status_line+="${p_mem}%"
echo "{Mem:$status_line}" echo "{Mem:$status_line}"
} }
@@ -74,7 +74,7 @@ swap() {
local status_line="" local status_line=""
status_line+="^c$grey^^r$base_x,${base_y},${bar_width},${max_height}^" status_line+="^c$grey^^r$base_x,${base_y},${bar_width},${max_height}^"
status_line+="^c$white^^r${base_x},${usage_y},${bar_width},${usage_height}^" status_line+="^c$white^^r${base_x},${usage_y},${bar_width},${usage_height}^"
status_line+="^d^^f5^" status_line+="^d^^f7^"
status_line+="${p_swap}%" status_line+="${p_swap}%"
echo "{Swap:$status_line}|" echo "{Swap:$status_line}|"
} }
@@ -118,7 +118,7 @@ cpu_temperature(){
local usage_height=$(($temp * 10 / $max_temp)) local usage_height=$(($temp * 10 / $max_temp))
local usage_y=$((adj_y + 10 - usage_height)) local usage_y=$((adj_y + 10 - usage_height))
local temp_icon="^c$black^" local temp_icon="^c$black^"
temp_icon+="^r7,${base_y},5,15^" #Bar behind the green temp_icon+="^r7,${base_y},5,15^" #Bar behind the fill
temp_icon+="^c$color^" temp_icon+="^c$color^"
temp_icon+="^r8,${usage_y},3,${usage_height}^" # Fill Bar temp_icon+="^r8,${usage_y},3,${usage_height}^" # Fill Bar
temp_icon+="^c$black^" temp_icon+="^c$black^"
@@ -171,14 +171,17 @@ wifi() {
ssid="${ssid:-No WiFi}" ssid="${ssid:-No WiFi}"
ssid="${ssid:0:15}" ssid="${ssid:0:15}"
local dwm=$(grep wlp0s20f3 /proc/net/wireless | awk '{ print int($4) }') local dwm=$(grep wlp0s20f3 /proc/net/wireless | awk '{ print int($4) }')
local signal_normalized=$(( (dwm + 90) * 100 / 60 )) if [ "$ssid" = "No WiFi" ]; then
local signal local signal=0
if [ $signal_normalized -gt 100 ]; then else
signal=100 local signal_normalized=$(( (dwm + 90) * 100 / 60 ))
elif [ $signal_normalized -lt 0 ]; then if [ $signal_normalized -gt 100 ]; then
signal=0 signal=100
else elif [ $signal_normalized -lt 0 ]; then
signal=$signal_normalized signal=0
else
signal=$signal_normalized
fi
fi fi
local color=$white local color=$white
@@ -209,12 +212,9 @@ wifi() {
echo "{ $wifi_icon$ssid : $signal% }" echo "{ $wifi_icon$ssid : $signal% }"
} }
status(){ status(){
echo "$(cpu)|$(ram)|$(swap)$(disk)|$(cpu_temperature)|$(battery)|$(wifi)" echo "$(cpu)|$(ram)|$(swap)$(disk)|$(cpu_temperature)|$(battery)|$(wifi)"
} }
while true; do while true; do
xsetroot -name "$(status)" xsetroot -name "$(status)"
done done

View File

@@ -1,4 +0,0 @@
#!/usr/bin/env bash
/home/klein/KleinWindowManagement/customstatusbar/systrays/screenshotsystray.sh &
/home/klein/KleinWindowManagement/customstatusbar/systrays/brightnesssystray2.sh &