summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.local/bin/fetch_mail.sh11
-rwxr-xr-x.local/bin/mic1
-rwxr-xr-x.local/bin/mixer-set3
-rwxr-xr-x.local/bin/status/sb-cpu27
-rwxr-xr-x.local/bin/status/sb-mpd5
-rwxr-xr-x.local/bin/status/sb-updatempd6
6 files changed, 34 insertions, 19 deletions
diff --git a/.local/bin/fetch_mail.sh b/.local/bin/fetch_mail.sh
index 8eb91e7..a0d6694 100755
--- a/.local/bin/fetch_mail.sh
+++ b/.local/bin/fetch_mail.sh
@@ -1,8 +1,17 @@
#!/bin/sh
+set -m
+
export GNUPGHOME=/home/jozan/.local/share/gnupg
export PASSWORD_STORE_DIR=/home/jozan/.local/share/pass
killall mbsync >/dev/null 2>&1
notify-send -u low -t 3000 'mbsync' ' fetching mail...' >/dev/null 2>&1
-mbsync -q -a -c /usr/home/jozan/.config/mbsync/mbsyncrc || notify-send -u low -t 6000 'mbsync' ' failed to fetch mail' >/dev/null 2>&1
+{
+ mbsync -q -a -c /usr/home/jozan/.config/mbsync/mbsyncrc ||
+ notify-send -u low -t 6000 'mbsync' ' failed to fetch mail' >/dev/null 2>&1 &&
+ (sleep 1; kill -74 $(pidof dwmblocks) >/dev/null 2>&1)
+}&
+gsleep 0.2
+kill -74 $(pidof dwmblocks) >/dev/null 2>&1
+fg
diff --git a/.local/bin/mic b/.local/bin/mic
index c8dd3a1..b53c966 100755
--- a/.local/bin/mic
+++ b/.local/bin/mic
@@ -43,6 +43,7 @@ sub main
);
};
}
+ system('kill -68 $(pidof dwmblocks)');
return;
}
diff --git a/.local/bin/mixer-set b/.local/bin/mixer-set
index 460086b..c5911bb 100755
--- a/.local/bin/mixer-set
+++ b/.local/bin/mixer-set
@@ -47,6 +47,7 @@ sub main {
'mixer-set',
'墳 Volume'
);
+ system('kill -68 $(pidof dwmblocks)');
exit;
}
elsif ($ARGV[0] eq "toggle") {
@@ -73,6 +74,7 @@ sub main {
'mixer-set',
'婢 Volume muted'
);
+ system('kill -68 $(pidof dwmblocks)');
}
else {
open(my $fh, '<:encoding(UTF-8)', $tmp_file);
@@ -106,6 +108,7 @@ sub main {
'mixer-set',
$icon . ' Volume restored'
);
+ system('kill -68 $(pidof dwmblocks)');
}
exit;
}
diff --git a/.local/bin/status/sb-cpu b/.local/bin/status/sb-cpu
index f6769a1..2504428 100755
--- a/.local/bin/status/sb-cpu
+++ b/.local/bin/status/sb-cpu
@@ -4,16 +4,17 @@ ncpu=$(sysctl -n hw.ncpu)
ncpu=$((ncpu - 1))
cpu=""
printf " "
-for i in $(seq 0 $ncpu); do
- case $(sysctl -n dev.cpu.$i.cx_usage | cut -d'.' -f1 | awk '{printf "%d\n", $1 / 12.5}') in
- "0") printf "▁";;
- "1") printf "▂";;
- "2") printf "▃";;
- "3") printf "▄";;
- "4") printf "▅";;
- "5") printf "▆";;
- "6") printf "▇";;
- "7") printf "█";;
- "8") printf "█";;
- esac;
-done
+w | head -n1 | awk '{print $8}' | cut -d',' -f1
+# for i in $(seq 0 $ncpu); do
+# case $(sysctl -n dev.cpu.$i.cx_usage | cut -d'.' -f1 | awk '{printf "%d\n", $1 / 12.5}') in
+# "0") printf "▁";;
+# "1") printf "▂";;
+# "2") printf "▃";;
+# "3") printf "▄";;
+# "4") printf "▅";;
+# "5") printf "▆";;
+# "6") printf "▇";;
+# "7") printf "█";;
+# "8") printf "█";;
+# esac;
+# done
diff --git a/.local/bin/status/sb-mpd b/.local/bin/status/sb-mpd
index 4fad1c2..e5f6745 100755
--- a/.local/bin/status/sb-mpd
+++ b/.local/bin/status/sb-mpd
@@ -1,4 +1,3 @@
-
#!/bin/sh
mp=$(mpc status)
@@ -9,7 +8,3 @@ case $icon in
*) return ;;
esac
printf "%s %s" "$icon" "$(echo "$mp" | head -n1)"
-
-# while : ; do
- # mpc idle >/dev/null
-# done
diff --git a/.local/bin/status/sb-updatempd b/.local/bin/status/sb-updatempd
new file mode 100755
index 0000000..878052a
--- /dev/null
+++ b/.local/bin/status/sb-updatempd
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+while true; do
+ mpc idle >/dev/null 2>&1
+ kill -75 $(pidof dwmblocks) >/dev/null 2>&1
+done