summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2022-10-09 00:42:48 -0500
committerzachir <zachir@librem.one>2022-10-09 00:42:48 -0500
commitd36e7cd095371deb8b70115fc7817d351bcfa645 (patch)
treee21aaae32fcd6debd1ff82e0bbb2e69f0208c4d2
parent0217995cda2e5b3700b911b5561e99c659fba92b (diff)
remove dwmblocks (those will be in their own repo
-rwxr-xr-xbattery21
-rwxr-xr-xclock12
-rwxr-xr-xcpu16
-rwxr-xr-xdisk20
-rwxr-xr-xinternet18
-rwxr-xr-xmemory12
-rwxr-xr-xmusic24
-rwxr-xr-xvolume23
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/ *$//'
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/<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")"
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"