From c866ba828c2b65feec1a05863682dd78bf5d5af7 Mon Sep 17 00:00:00 2001 From: krolyxon Date: Tue, 21 Mar 2023 21:47:27 +0530 Subject: switch to dwmblocks --- .local/bin/sbar | 84 --------------------------------------------------------- 1 file changed, 84 deletions(-) delete mode 100755 .local/bin/sbar (limited to '.local/bin/sbar') diff --git a/.local/bin/sbar b/.local/bin/sbar deleted file mode 100755 index cd32308..0000000 --- a/.local/bin/sbar +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/env sh - -# INIT -printf "$$" > ~/.cache/pidofbar -sec=0 - -# MODULES -update_cpu () { - cpu=" $(grep -o "^[^ ]*" /proc/loadavg )" -} - -update_memory () { - memory=" $(free -h --si | sed -n "2s/\([^ ]* *\)\{2\}\([^ ]*\).*/\2/p")" -} - -update_time () { - time="$(date "+[  %a %d %b ] [  %I:%M %P ]")" -} - -update_music () { - # music="[ $(sb-music) ] " - if [ -z "$(sb-music)" ]; then - music="" - else - music="[ $(sb-music) ] " - fi -} - -# update_bat () { -# # you might need to change the path depending on your device -# read -r bat_status \3]_")" -# [ "[]" = "$event" ] && event="" -#} - - -# modules that don't update on their own need to be run at the start for getting their initial value -# update_vol - -display () { - #printf "%s\n" " $event [$memory $cpu] [$bat] [$backlight] [$vol] $time " - xsetroot -name "$music[ $vol ] [ $memory $cpu ] $time " -} - -# SIGNALLING -# trap ";display" "RTMIN+n" -trap "update_vol;display" "RTMIN" -trap "update_music;display" "RTMIN+10" -# trap "update_bat;display" "RTMIN+2" -# to update it from external commands -## kill -m "$(cat ~/.cache/pidofbar)" -# where m = 34 + n - -while true -do - sleep 1 & wait && { - # to update item ever n seconds with a offset of m - ## [ $((sec % n)) -eq m ] && udpate_item - [ $((sec % 5 )) -eq 0 ] && update_time # update time every 5 seconds - [ $((sec % 5 )) -eq 0 ] && update_vol # update vol every 5 seconds - [ $((sec % 5 )) -eq 0 ] && update_music # update music every 5 seconds - [ $((sec % 5)) -eq 0 ] && update_cpu # update cpu every 15 seconds - [ $((sec % 5)) -eq 0 ] && update_memory - # [ $((sec % 60)) -eq 0 ] && update_bat - #[ $((sec % 300)) -eq 1 ] && update_event - - # how often the display updates ( 5 seconds ) - [ $((sec % 5 )) -eq 0 ] && display - sec=$((sec + 1)) - } -done - - -- cgit v1.2.3