From d36e7cd095371deb8b70115fc7817d351bcfa645 Mon Sep 17 00:00:00 2001 From: zachir Date: Sun, 9 Oct 2022 00:42:48 -0500 Subject: remove dwmblocks (those will be in their own repo --- battery | 21 --------------------- clock | 12 ------------ cpu | 16 ---------------- disk | 20 -------------------- internet | 18 ------------------ memory | 12 ------------ music | 24 ------------------------ volume | 23 ----------------------- 8 files changed, 146 deletions(-) delete mode 100755 battery delete mode 100755 clock delete mode 100755 cpu delete mode 100755 disk delete mode 100755 internet delete mode 100755 memory delete mode 100755 music delete mode 100755 volume 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/ *$//' diff --git a/clock b/clock deleted file mode 100755 index 81397af..0000000 --- a/clock +++ /dev/null @@ -1,12 +0,0 @@ -#!/sbin/sh - -case $BLOCK_BUTTON in - 1) notify-send "This Month" "$(cal --color=always | sed "s/..7m//;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")" diff --git a/cpu b/cpu deleted file mode 100755 index 283cd40..0000000 --- a/cpu +++ /dev/null @@ -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%]" - diff --git a/disk b/disk deleted file mode 100755 index abfb64d..0000000 --- a/disk +++ /dev/null @@ -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)" diff --git a/memory b/memory deleted file mode 100755 index e9f8b2b..0000000 --- a/memory +++ /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))}' diff --git a/music b/music deleted file mode 100755 index 2ec8aec..0000000 --- a/music +++ /dev/null @@ -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 diff --git a/volume b/volume deleted file mode 100755 index 1c67faf..0000000 --- a/volume +++ /dev/null @@ -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" -- cgit v1.2.3