diff options
-rwxr-xr-x | battery | 21 | ||||
-rwxr-xr-x | clock | 12 | ||||
-rwxr-xr-x | cpu | 16 | ||||
-rwxr-xr-x | disk | 20 | ||||
-rwxr-xr-x | internet | 18 | ||||
-rwxr-xr-x | memory | 12 | ||||
-rwxr-xr-x | music | 24 | ||||
-rwxr-xr-x | volume | 23 |
8 files changed, 0 insertions, 146 deletions
diff --git a/battery b/battery deleted file mode 100755 index fb5349c..0000000 --- a/battery +++ /dev/null @@ -1,21 +0,0 @@ -#!/sbin/sh - -case $BLOCK_BUTTON in - 2) notify-send "Battery module" "- : discharging -X : not charging -? : unknown -+ : charging -| : charged -! : battery very low!" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -ls /sys/class/power_supply/ | grep -i bat | head -1 | while read battery; -do - capacity=$(cat "/sys/class/power_supply/$battery"/capacity) || break - status=$(sed "s/[Dd]ischarging/-/;s/[Nn]ot charging/X/;s/[Cc]harging/+/;s/[Uu]nknown/?/;s/[Ff]ull/|/" "/sys/class/power_supply/$battery"/status) - - [ "$capacity" -le 25 ] && [ "$status" = "!" ] && warn="!" - printf "[%s%s%s]" "$status" "$warn" "$capacity" - unset warn -done | sed 's/ *$//' @@ -1,12 +0,0 @@ -#!/sbin/sh - -case $BLOCK_BUTTON in - 1) notify-send "This Month" "$(cal --color=always | sed "s/..7m/<b><span color=\"red\">/;s/..27m/<\/spawn<\/b>/")" && notify-send "Appointments" "$(calcurse -D ~/.config/calcurse -d3)" ;; - 2) notify-send "Time/date module" "\- Left click to show upcoming appointmnets for the next three days via \`calcurse -d3\` and show the month via \`cal\` -- Middle click to show this message -- Right click to open calcurse" ;; - 3) setsid -f "$TERMINAL" -e calcurse -D ~/.config/calcurse ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -printf "[%s]" "$(date "+%Y %b %d (%a) %I:%M%p")" @@ -1,16 +0,0 @@ -#!/sbin/sh - -case $BLOCK_BUTTON in - 1) notify-send "CPU hogs" "$(ps axch -o comm,%cpu --sort=-%cpu | head)\\n(100% per core)" ;; - 2) notify-send "CPU module" "\- Shows CPU usage. -- Click to show intensive progresses. -- Middle click to show this tip -- Right click to open htop" ;; - 3) setsid -f "$TERMINAL" -e htop ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -usage=$(mpstat 1 1 | sed '1,4d;s/.* //') -output="$(echo $usage | awk '{printf ("%2.2f", (100 - $1))}' | cut -c-4)" -echo -n "[$output%]" - @@ -1,20 +0,0 @@ -#!/sbin/sh - -location=${1:-/} - -[ -d "$location" ] || exit - -case $BLOCK_BUTTON in - 1) notify-send "💽 Disk space" "$(df -h --output=target,used,size)" ;; - 3) notify-send "💽 Disk module" "\- Shows used hard drive space. -- Click to show all disk info." ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -case "$location" in - "/home"* ) icon="h" ;; - "/mnt"* ) icon="m" ;; - *) icon="s";; -esac - -printf "[%s: %s]" "$icon" "$(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')" diff --git a/internet b/internet deleted file mode 100755 index 5850a13..0000000 --- a/internet +++ /dev/null @@ -1,18 +0,0 @@ -#!/sbin/sh - -case $BLOCK_BUTTON in - 1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;; - 2) notify-send "Internet module" "\- Click to connect -X : no wifi connection -+ : wifi connection -_ : no ethernet -- : ethernet working" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in - down) wifiicon="X" ;; - up) wifiicon="$(awk '/^\s*w/ { print "+", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;; -esac - -printf "[%s%s]" "$wifiicon" "$(sed "s/down/_/;s/up/-/" /sys/class/net/e*/operstate 2>/dev/null)" @@ -1,12 +0,0 @@ -#!/sbin/sh - -case $BLOCK_BUTTON in - 1) notify-send "Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;; - 2) notify-send "Memory module" "\- Shows Memory Used/Total. -- Click to show memory hogs. -- Right click to open htop." ;; - 3) setsid -f "$TERMINAL" -e htop ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -free --mebi | sed -n '2{p;q}' | awk '{printf ("[%2.2fGiB/%2.2fGiB]", ( $3 / 1024), ($2 / 1024))}' @@ -1,24 +0,0 @@ -#!/sbin/sh - -filter() { - if [ `pgrep -x mpd` ]; then - MPCSTAT="$(mpc status)" ; - printf "%s%s%s" "$(echo $MPCSTAT | head -1 | grep -v '^volume' | cut -d'-' -f1 | sed 's/ $//' | cut -c-10)" "$(echo $MPCSTAT | grep -vq '^volume' && echo ' - ')" "$(echo $MPCSTAT | head -1 | grep -v '^volume' | cut -d'-' -f2 | sed 's/^ //' | cut -c-10)" - fi -} - -pidof -x mpdup >/dev/null 2>&1 || mpdup >/dev/null 2>&1 & - -case $BLOCK_BUTTON in - 1) mpc status | filter ; setsid -f "$TERMINAL" -e ncmpcpp ;; # left click, open music player - 3) mpc toggle | filter ;; # right click, pause/unpause - 2) mpc status | filter ; notify-send "🎵 Music module" "\- Shows mpd song playing. -- Italic when paused. -- Left click opens ncmpcpp. -- Middle click pauses. -- Scroll changes track.";; # right click, pause/unpause - 4) mpc prev | filter ;; # scroll up, previous - 5) mpc next | filter ;; # scroll down, next - 6) mpc status | filter ; "$TERMINAL" -e "$EDITOR" "$0" ;; - *) filter ;; -esac @@ -1,23 +0,0 @@ -#!/sbin/sh - -case $BLOCK_BUTTON in - 1) - pgrep -x pipewire >/dev/null && MIXER="pulsemixer" || \ - pgrep -x pulseaudio >/dev/null && MIXER="pulsemixer" || \ - MIXER="alsamixer" - setsid -f $TERMINAL -e $MIXER - ;; - 2) notify-send "Volume module" "\- Shows volume, X if muted. -- Middle click to show this message. -- Right click to mute. -- Scroll to change." ;; - 3) volsv -t ;; - 4) volsv -i ;; - 5) volsv -d ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac -volstat="$(volsv -v)" -mutstat="$(volsv -g)" -echo "$mutstat" | grep -q "\[off\]" && printf "[X]" && exit -vol="$(echo "$volstat" | grep '[0-9]\+%' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")" -printf "[%s]" "$vol" |