From 9addbecbf31bab7088d3089a99964eeb3c6c7928 Mon Sep 17 00:00:00 2001 From: Joe Date: Wed, 17 Aug 2022 14:37:44 +0200 Subject: update --- .local/bin/status/sb-cpu | 27 ++++++++++++++------------- .local/bin/status/sb-mpd | 5 ----- .local/bin/status/sb-updatempd | 6 ++++++ 3 files changed, 20 insertions(+), 18 deletions(-) create mode 100755 .local/bin/status/sb-updatempd (limited to '.local/bin/status') diff --git a/.local/bin/status/sb-cpu b/.local/bin/status/sb-cpu index f6769a1..2504428 100755 --- a/.local/bin/status/sb-cpu +++ b/.local/bin/status/sb-cpu @@ -4,16 +4,17 @@ ncpu=$(sysctl -n hw.ncpu) ncpu=$((ncpu - 1)) cpu="" printf " " -for i in $(seq 0 $ncpu); do - case $(sysctl -n dev.cpu.$i.cx_usage | cut -d'.' -f1 | awk '{printf "%d\n", $1 / 12.5}') in - "0") printf "▁";; - "1") printf "▂";; - "2") printf "▃";; - "3") printf "▄";; - "4") printf "▅";; - "5") printf "▆";; - "6") printf "▇";; - "7") printf "█";; - "8") printf "█";; - esac; -done +w | head -n1 | awk '{print $8}' | cut -d',' -f1 +# for i in $(seq 0 $ncpu); do +# case $(sysctl -n dev.cpu.$i.cx_usage | cut -d'.' -f1 | awk '{printf "%d\n", $1 / 12.5}') in +# "0") printf "▁";; +# "1") printf "▂";; +# "2") printf "▃";; +# "3") printf "▄";; +# "4") printf "▅";; +# "5") printf "▆";; +# "6") printf "▇";; +# "7") printf "█";; +# "8") printf "█";; +# esac; +# done diff --git a/.local/bin/status/sb-mpd b/.local/bin/status/sb-mpd index 4fad1c2..e5f6745 100755 --- a/.local/bin/status/sb-mpd +++ b/.local/bin/status/sb-mpd @@ -1,4 +1,3 @@ - #!/bin/sh mp=$(mpc status) @@ -9,7 +8,3 @@ case $icon in *) return ;; esac printf "%s %s" "$icon" "$(echo "$mp" | head -n1)" - -# while : ; do - # mpc idle >/dev/null -# done diff --git a/.local/bin/status/sb-updatempd b/.local/bin/status/sb-updatempd new file mode 100755 index 0000000..878052a --- /dev/null +++ b/.local/bin/status/sb-updatempd @@ -0,0 +1,6 @@ +#!/bin/sh + +while true; do + mpc idle >/dev/null 2>&1 + kill -75 $(pidof dwmblocks) >/dev/null 2>&1 +done -- cgit v1.2.3