Adding my personal blocks

pull/11/head
Ashish Kumar Yadav 4 years ago
parent d97732daf9
commit 93c80d538a

@ -1,7 +1,7 @@
/* time interval in seconds to sleep before looking for updates in the main loop */
#define SLEEPINTERVAL 30
#define PATH(name) "/home/ashish/.scripts/statusbar/"name
#define PATH(name) "/home/ashish/.local/projects/dwmblocks/blocks/"name
/* If multiple realtime signals are pending, then the lowest numbered signal is delivered first.
* If interval of a block is set to 0, the block will only be updated once at startup.

@ -0,0 +1,3 @@
#!/bin/dash
read -r capacity </sys/class/power_supply/BAT0/capacity
echo "${capacity}%"

@ -0,0 +1,6 @@
#!/bin/dash
case "$1" in
1) exec termite -e "htop -s PERCENT_CPU" ;;
2) exec termite -e "htop" ;;
3) exec termite -e "htop -s PERCENT_MEM" ;;
esac

@ -0,0 +1,2 @@
#!/bin/dash
echo "$(date '+%a, %d %b')"

@ -0,0 +1,6 @@
#!/bin/dash
case "$1" in
1) exec termite -e "htop -s PERCENT_CPU" ;;
2) exec termite -e "htop" ;;
3) exec termite -e "htop -s PERCENT_MEM" ;;
esac

@ -0,0 +1,12 @@
#!/bin/dash
crit=70
read -r temp </sys/class/thermal/thermal_zone0/temp
temp=${temp%???}
if [ "$temp" -ge "$crit" ] ; then
echo "${temp}°C"
else
echo "${temp}°C"
fi

@ -0,0 +1,6 @@
#!/bin/dash
case "$1" in
1) exec termite -e "htop -s PERCENT_CPU" ;;
2) exec termite -e "htop" ;;
3) exec termite -e "htop -s PERCENT_MEM" ;;
esac

@ -0,0 +1,6 @@
#!/bin/dash
if [ "$1" = 1 ] ; then
echo ""
else
echo ""
fi

@ -0,0 +1,4 @@
#!/bin/dash
case "$1" in
1|2|3) echo "turn off hotspot" ;;
esac

@ -0,0 +1,12 @@
#!/bin/dash
crit=70
read -r temp </sys/class/thermal/thermal_zone0/temp
temp=${temp%???}
if [ "$temp" -ge "$crit" ] ; then
echo "${temp}°C"
else
echo "${temp}°C"
fi

@ -0,0 +1,6 @@
#!/bin/dash
case "$1" in
1) setsid -f termite -e "htop -s PERCENT_CPU" ;;
2) setsid -f termite -e "htop" ;;
3) setsid -f termite -e "htop -s PERCENT_MEM" ;;
esac

@ -0,0 +1,7 @@
#!/bin/dash
pactl subscribe |
while read -r output ; do
if [ -z "${output##*sink *}" ] ; then
sigdsblocks 1
fi
done

@ -0,0 +1,2 @@
#!/bin/dash
echo "$(date '+%H:%M')"

@ -0,0 +1,9 @@
#!/bin/dash
volstat=$(pamixer --get-mute --get-volume)
if "${volstat% *}" ; then
echo "${volstat#* }%"
else
echo "${volstat#* }%"
fi

@ -0,0 +1,6 @@
#!/bin/dash
case "$1" in
1) pamixer --toggle-mute ;;
2) exec pavucontrol-qt ;;
3) pamixer --set-volume 60 ;;
esac
Loading…
Cancel
Save