diff options
Diffstat (limited to '.local/bin/status')
-rwxr-xr-x | .local/bin/status/sb-battery | 33 | ||||
-rwxr-xr-x | .local/bin/status/sb-clock | 29 | ||||
-rwxr-xr-x | .local/bin/status/sb-cpu | 37 | ||||
-rwxr-xr-x | .local/bin/status/sb-disk | 9 | ||||
-rwxr-xr-x | .local/bin/status/sb-forecast | 17 | ||||
-rwxr-xr-x | .local/bin/status/sb-mailbox | 51 | ||||
-rwxr-xr-x | .local/bin/status/sb-memory | 15 | ||||
-rwxr-xr-x | .local/bin/status/sb-mpd | 11 | ||||
-rwxr-xr-x | .local/bin/status/sb-net | 23 | ||||
-rwxr-xr-x | .local/bin/status/sb-os | 9 | ||||
-rwxr-xr-x | .local/bin/status/sb-temp | 7 | ||||
-rwxr-xr-x | .local/bin/status/sb-tools | 10 | ||||
-rwxr-xr-x | .local/bin/status/sb-updatempd | 6 | ||||
-rwxr-xr-x | .local/bin/status/sb-volume | 33 |
14 files changed, 0 insertions, 290 deletions
diff --git a/.local/bin/status/sb-battery b/.local/bin/status/sb-battery deleted file mode 100755 index 2fe3ce5..0000000 --- a/.local/bin/status/sb-battery +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -case $(hostname -s) in - mother) exit ;; - po-rbo) - printf "^c#fabd2f^" - charge=$(cat /sys/class/power_supply/BAT0/capacity) - case "$(cat /sys/class/power_supply/BAT0/status)" in - "Charging"|"Not charging") printf " " ;; - "Full") printf " "; return ;; - esac - ;; - mars) - echo -n "^c#fabd2f^" - charge=$(apm -l) - [ "$(apm -b)" -eq 3 ] && printf " " - ;; -esac - -case $(echo "$charge" / 20 | bc) in - "0") printf " " ;; - "1") printf " " ;; - "2") printf " " ;; - "3") printf " " ;; - "4") - [ "$charge" -gt 98 ] && return - printf " " - ;; - "5") - [ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ] && return - printf "" - ;; -esac diff --git a/.local/bin/status/sb-clock b/.local/bin/status/sb-clock deleted file mode 100755 index cf315f0..0000000 --- a/.local/bin/status/sb-clock +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -echo -n "^d^" -clock=$(date '+%I') - -case "$clock" in - "00") icon="" ;; - "01") icon="" ;; - "02") icon="" ;; - "03") icon="" ;; - "04") icon="" ;; - "05") icon="" ;; - "06") icon="" ;; - "07") icon="" ;; - "08") icon="" ;; - "09") icon="" ;; - "10") icon="" ;; - "11") icon="" ;; - "12") icon="" ;; -esac - -# case $BLOCK_BUTTON in -# 1) notify-send -u low "This Month" "$(cal | sed "s/..7m/<b><span color=\"red\">/;s|..27m|</span></b>|")" && notify-send "Appointments" "$(calcurse -d3)" ;; -# 2) bsdsetsid -f "$TERMINAL" -e calcurse -C $XDG_CONFIG_HOME/calcurse -D $XDG_DATA_HOME/calcurse ;; -# 3) notify-send -u low "📅 Time/date module" "\- Left click to show upcoming appointments for the next three days via \`calcurse -d3\` and show the month via \`cal\` - Middle click opens calcurse if installed" ;; -# 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -# esac - -date "+$icon %H:%M" diff --git a/.local/bin/status/sb-cpu b/.local/bin/status/sb-cpu deleted file mode 100755 index fe3712a..0000000 --- a/.local/bin/status/sb-cpu +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -# ncpu_file="/tmp/ncpu" -# if [ -f $ncpu_file ]; then -# ncpu=$(cat $ncpu_file) -# else -# ncpu=$(sysctl -n hw.ncpu | tee $ncpu_file) -# fi - -printf "^c#8ec07c^ " -# for i in $(top -P -d 2 -s 0.2 | grep '^CPU' | tail -n$ncpu | sed '{s/% idle$//;s/.*[[:blank:]]//;s/\..*//;s/^/100 - /;}' | bc); do -case $(hostname -s) in - mother|po-rbo) - stats=$(uptime | head -n1) - top -b -d 0.1 -n 1 | grep "Cpu(s)" | \ - sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | \ - awk '{print int(100 - $1)"%"}' - exit - ;; - mars) - stats=$(top -d 2 -s 0.2 | grep -E 'load averages:|^CPU') - printf "%s " "$(echo "$stats" | sed '{1,2d;4d;s/.*averages: *//;s/,.*//;}')" - ;; -esac - -case $(echo "$stats" | sed '{1,3d;s/% idle$//;s/.*[[:blank:]]//;s/\..*//;s/^/(100 - /;s/$/) \/ 12\.5/;}' | bc) in - "0") printf "[ ]\n" ;; - "1") printf "[= ]\n" ;; - "2") printf "[== ]\n" ;; - "3") printf "[=== ]\n" ;; - "4") printf "[==== ]\n" ;; - "5") printf "[===== ]\n" ;; - "6") printf "[====== ]\n" ;; - "7") printf "[======= ]\n" ;; - "8") printf "[========]\n" ;; -esac - diff --git a/.local/bin/status/sb-disk b/.local/bin/status/sb-disk deleted file mode 100755 index 527a1d1..0000000 --- a/.local/bin/status/sb-disk +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -echo -n "^c#d3869b^ " -df=$(df -h -T | grep '/$') -if echo "$df" | grep zfs >/dev/null 2>&1; then - zpool list $(echo $df | sed 's/\/.*//') | tail -n1 | awk '{print $3"/"$2}' -else - echo "$df" | awk '{print $6}' -fi diff --git a/.local/bin/status/sb-forecast b/.local/bin/status/sb-forecast deleted file mode 100755 index e3c8f0d..0000000 --- a/.local/bin/status/sb-forecast +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -# weatherreport="/tmp/weatherreport" -# weatherglyph="/tmp/weatherglyph" -# moonglyph="/tmp/moonglyph" - -weatherreport=$(curl -sf "wttr.in/Lyon" 2>&1 || exit 1) # >$weatherreport || (rm -f $weatherreport && exit 1) -weatherglyph=$(curl -sf "wttr.in/Lyon?format=%c" 2>&1 || exit 1) # >$weatherglyph || exit 1 -moonglyph=$(curl -sf "wttr.in/?format=%m" 2>&1 || exit 1) # >$moonglyph || exit 1 - -printf "^c#83a598^%s%s" \ - "$(echo "$weatherglyph")" \ - "$(echo "$weatherreport" | sed '16q;d' | grep -wo "[0-9]*%" | sort -rn | sed "s/^/ /g;1q" | tr -d '\n')" - -echo "$weatherreport" | sed '13q;d' | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | - sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | - awk -v moon="$(echo "$moonglyph")" '{print " " $1 "/" $2 "°C " moon}' diff --git a/.local/bin/status/sb-mailbox b/.local/bin/status/sb-mailbox deleted file mode 100755 index f7a3786..0000000 --- a/.local/bin/status/sb-mailbox +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh - -# Displays number of unread mail and an loading icon if updating. -# When clicked, brings up `neomutt`. - -case $BLOCK_BUTTON in - 1) setsid -f "$TERMINAL" -e neomutt ;; - 2) setsid -f mw -Y >/dev/null ;; - 3) notify-send "📬 Mail module" "\- Shows unread mail -- Shows 🔃 if syncing mail -- Left click opens neomutt -- Middle click syncs mail" ;; - 6) "$TERMINAL" -e "$EDITOR" "$0" ;; -esac - -mb_a="$(ls "${MAIL:-/var/mail/jozan}"/gmail_br/INBOX/new/ | wc -l 2>/dev/null)" -mb_b="$(ls "${MAIL:-/var/mail/jozan}"/gmail_oon/INBOX/new/ | wc -l 2>/dev/null)" -mb_c="$(ls "${MAIL:-/var/mail/jozan}"/gmail_tos/INBOX/new/ | wc -l 2>/dev/null)" - -sync=0 -if pidof mbsync >/dev/null 2>&1; then - sync=1 -fi - -case "$sync" in - 0) ([ "$mb_a" -gt 0 ] || [ "$mb_b" -gt 0 ] || [ "$mb_c" -gt 0 ] || [ "$mb_d" -gt 0 ]) && echo -n " " ;; - 1) echo -n " " ;; - *) ;; -esac - -if [ "$mb_a" -gt 0 ]; then - echo -n "br:" $mb_a -fi - -if [ "$mb_a" -gt 0 ] && [ "$mb_b" -gt 0 ]; then - echo -n " - " -fi - -if [ "$mb_b" -gt 0 ]; then - echo -n "oon:" $mb_b -fi - -if [ "$mb_b" -gt 0 ] && [ "$mb_c" -gt 0 ]; then - echo -n " - " -elif [ "$mb_a" -gt 0 ] && [ "$mb_c" -gt 0 ]; then - echo -n " - " -fi - -if [ "$mb_c" -gt 0 ]; then - echo -n "tos:" $mb_c -fi diff --git a/.local/bin/status/sb-memory b/.local/bin/status/sb-memory deleted file mode 100755 index 0786b85..0000000 --- a/.local/bin/status/sb-memory +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -echo -n "^c#b8bb26^ " -case $(hostname -s) in - mother|po-rbo) - free | sed -n '2p' | awk '{print int(100 - ($7 * 100 / $2))"%"}' - ;; - mars) - sysctl -n hw.physmem \ - hw.pagesize \ - vm.stats.vm.v_inactive_count \ - vm.stats.vm.v_free_count \ - vm.stats.vm.v_cache_count | xargs | awk '{printf ("%2.2fG/%2.2fG\n", ($1 / (1024 ^ 3)) - (($3 + $4 + $5) * $2 / (1024 ^ 3)), ($1 / (1024 ^ 3)))}' - ;; -esac diff --git a/.local/bin/status/sb-mpd b/.local/bin/status/sb-mpd deleted file mode 100755 index 21bf2c7..0000000 --- a/.local/bin/status/sb-mpd +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -return -mp=$(mpc status) -icon=$(echo "$mp" | sed -n 2p | sed -E 's/(^|\])[^[]*($|\[)//g') -case $icon in - "playing") icon="契" ;; - "paused") icon="" ;; - *) return ;; -esac -printf "%s %s" "$icon" "$(echo "$mp" | head -n1)" diff --git a/.local/bin/status/sb-net b/.local/bin/status/sb-net deleted file mode 100755 index 50fdc0a..0000000 --- a/.local/bin/status/sb-net +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -echo -n "^c#a89984^" -case $(hostname -s) in - mother|po-rbo) ping="ping -c1 -w1 9.9.9.9" ;; - mars) ping="ping -c1 -t1 9.9.9.9" ;; -esac -ifc=$(ifconfig) -if echo "$ifc" | grep -E '^wg' >/dev/null 2>&1; then - echo -n " " -fi -if echo "${ifc}" | grep -E '^zt' >/dev/null 2>&1; then - echo -n " " -fi -if echo "${ifc}" | grep -E '^tun|^vpn' >/dev/null 2>&1; then - echo -n " " -fi -if ! $ping >/dev/null 2>&1; then - echo "" - exit -fi - -echo "" diff --git a/.local/bin/status/sb-os b/.local/bin/status/sb-os deleted file mode 100755 index 304aa19..0000000 --- a/.local/bin/status/sb-os +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -case $(hostname -s) in - mother) os="^c#83a598^" ;; - po-rbo) os="^c#8ec07c^" ;; - mars) os="^c#fb4934^" ;; -esac - -echo "$os " diff --git a/.local/bin/status/sb-temp b/.local/bin/status/sb-temp deleted file mode 100755 index dfa17c7..0000000 --- a/.local/bin/status/sb-temp +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -case $(hostname -s) in - mother) ;; - po-rbo) cat /sys/class/hwmon/hwmon5/temp1_input | awk '{printf ("^c#fb4934^ %3.1f°C", ($1 / 1000))}' ;; - mars) echo -n "" $(sysctl -n dev.cpu.0.temperature | cut -d '.' -f1)"°C" ;; -esac diff --git a/.local/bin/status/sb-tools b/.local/bin/status/sb-tools deleted file mode 100755 index 9c7484c..0000000 --- a/.local/bin/status/sb-tools +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -if pidof emacs-28.2 >/dev/null 2>&1; then - echo -n " " -fi -if pgrep gpg-agent >/dev/null 2>&1; then - echo -n " " -else - echo -n " " -fi diff --git a/.local/bin/status/sb-updatempd b/.local/bin/status/sb-updatempd deleted file mode 100755 index 878052a..0000000 --- a/.local/bin/status/sb-updatempd +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -while true; do - mpc idle >/dev/null 2>&1 - kill -75 $(pidof dwmblocks) >/dev/null 2>&1 -done diff --git a/.local/bin/status/sb-volume b/.local/bin/status/sb-volume deleted file mode 100755 index bc1ca97..0000000 --- a/.local/bin/status/sb-volume +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -[ $(hostname -s) = "mars" ] || return - -vol="$(mixer vol | awk '{print $7}' | cut -d ':' -f1)" - -if [ "$vol" -gt "0" ]; then - icon="" -else - icon="婢" -fi - -mic="$(mixer rec | awk '{print $7}' | cut -d ':' -f1)" - -if [ "$mic" -gt "0" ]; then - micon="" -else - micon="" -fi - -echo -n "$micon $icon " - -case $(echo $vol / 12.5 | bc) in - "0") printf "[ ]";; - "1") printf "[= ]";; - "2") printf "[== ]";; - "3") printf "[=== ]";; - "4") printf "[==== ]";; - "5") printf "[===== ]";; - "6") printf "[====== ]";; - "7") printf "[======= ]";; - "8") printf "[========]";; -esac |