add Lenovox1en5 polybar & i3wm configs, change MacOS folder to macos

This commit is contained in:
Toniiz
2024-07-29 15:24:07 -07:00
parent 6cd88e865f
commit 45c0447ce6
29 changed files with 597 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
#!/bin/bash
CORE_COUNT=$(sysctl -n machdep.cpu.thread_count)
CPU_INFO=$(ps -eo pcpu,user)
CPU_SYS=$(echo "$CPU_INFO" | grep -v $(whoami) | sed "s/[^ 0-9\.]//g" | awk "{sum+=\$1} END {print sum/(100.0 * $CORE_COUNT)}")
CPU_USER=$(echo "$CPU_INFO" | grep $(whoami) | sed "s/[^ 0-9\.]//g" | awk "{sum+=\$1} END {print sum/(100.0 * $CORE_COUNT)}")
CPU_PERCENT="$(echo "$CPU_SYS $CPU_USER" | awk '{printf "%.0f\n", ($1 + $2)*100}')"
sketchybar --set $NAME label="$CPU_PERCENT%"