From fd98b1d6671858a2a725634c82d6907ec25771ea Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Sun, 21 Mar 2021 14:35:21 +0530 Subject: FINALLY THIS WORKS PROPERLY (Pushing all the dotfiles) --- .config/lemonblocks/modules/cpu_load.sh | 10 ++++++++++ .config/lemonblocks/modules/cpu_temp.sh | 5 +++++ .config/lemonblocks/modules/date.sh | 3 +++ .config/lemonblocks/modules/mem_usage.sh | 4 ++++ .config/lemonblocks/modules/volume.sh | 9 +++++++++ 5 files changed, 31 insertions(+) create mode 100755 .config/lemonblocks/modules/cpu_load.sh create mode 100755 .config/lemonblocks/modules/cpu_temp.sh create mode 100755 .config/lemonblocks/modules/date.sh create mode 100755 .config/lemonblocks/modules/mem_usage.sh create mode 100755 .config/lemonblocks/modules/volume.sh (limited to '.config/lemonblocks/modules') diff --git a/.config/lemonblocks/modules/cpu_load.sh b/.config/lemonblocks/modules/cpu_load.sh new file mode 100755 index 0000000..1a677a9 --- /dev/null +++ b/.config/lemonblocks/modules/cpu_load.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +read cpu a b c previdle rest < /proc/stat +prevtotal=$((a+b+c+previdle)) +sleep 0.5 +read cpu a b c idle rest < /proc/stat +total=$((a+b+c+idle)) +cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) )) + +printf " CPU:%s%% " $cpu diff --git a/.config/lemonblocks/modules/cpu_temp.sh b/.config/lemonblocks/modules/cpu_temp.sh new file mode 100755 index 0000000..a5286ad --- /dev/null +++ b/.config/lemonblocks/modules/cpu_temp.sh @@ -0,0 +1,5 @@ +#!/bin/bash +CEL=$'\xc2\xb0C' +temp=$( cat /sys/devices/virtual/thermal/thermal_zone0/temp ) +temp=`expr $temp / 1000` +printf " TEMP:$temp$CEL " diff --git a/.config/lemonblocks/modules/date.sh b/.config/lemonblocks/modules/date.sh new file mode 100755 index 0000000..dcd0681 --- /dev/null +++ b/.config/lemonblocks/modules/date.sh @@ -0,0 +1,3 @@ +#!/bin/bash +date=$(date +"%d %b(%A) %H:%M") +printf " $date " diff --git a/.config/lemonblocks/modules/mem_usage.sh b/.config/lemonblocks/modules/mem_usage.sh new file mode 100755 index 0000000..6b939eb --- /dev/null +++ b/.config/lemonblocks/modules/mem_usage.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +mem=$(free -m | grep Mem: | awk '{print$3 / $2 * 100}') +printf " MEM: %.0f%% " $mem diff --git a/.config/lemonblocks/modules/volume.sh b/.config/lemonblocks/modules/volume.sh new file mode 100755 index 0000000..e67c63f --- /dev/null +++ b/.config/lemonblocks/modules/volume.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +printf " VOL:$(pamixer --get-volume-human) " "" +# if [ $volume_level == "muted" ]; then + # printf "%{F#ff0058}VOL: $(pamixer --get-volume)%{F-}" +# else + # printf "VOL: $volume_level" +# fi + -- cgit v1.2.3