summaryrefslogtreecommitdiff
path: root/mut/bin
diff options
context:
space:
mode:
authorMike Vink <mike@pionative.com>2024-02-11 12:16:07 +0100
committerMike Vink <mike@pionative.com>2024-02-11 12:16:28 +0100
commit1022a09fc4d8ac7c28031d777097c22799507007 (patch)
tree783f6c746f3b2e74892e84eee701fca678248b95 /mut/bin
parentc5ce00c6ffbf3be933c28b5c0d34afb987da26c3 (diff)
some random stuff
Diffstat (limited to 'mut/bin')
-rwxr-xr-xmut/bin/notmuch-hook2
-rwxr-xr-xmut/bin/sb-volume39
2 files changed, 39 insertions, 2 deletions
diff --git a/mut/bin/notmuch-hook b/mut/bin/notmuch-hook
index 147559e..8203558 100755
--- a/mut/bin/notmuch-hook
+++ b/mut/bin/notmuch-hook
@@ -1,7 +1,5 @@
-. <(pass show personal/notmuch)
notmuch new --quiet
notmuch tag -new +unread +jobs -- 'tag:new and (from:jobs-listings* or from:jobs-noreply*)'
-notmuch tag -new +unread +houses -- 'tag:new and (from:"'$MAKELAAR'" or thread:{'$MAKELAAR'})'
notmuch tag -new +unread +dev -- 'tag:new and (from:/.*github.com/ or thread:{from:/.*github.com/})'
# New needs to be removed, otherwise it will re add inbox unread
diff --git a/mut/bin/sb-volume b/mut/bin/sb-volume
new file mode 100755
index 0000000..e66dea7
--- /dev/null
+++ b/mut/bin/sb-volume
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Prints the current volume or 🔇 if muted.
+
+case $BLOCK_BUTTON in
+ 1) setsid -w -f "$TERMINAL" -e pulsemixer; pkill -RTMIN+10 "${STATUSBAR:-dwmblocks}" ;;
+ 2) wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle ;;
+ 4) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%+ ;;
+ 5) wpctl set-volume @DEFAULT_AUDIO_SINK@ 1%- ;;
+ 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
+- Middle click to mute.
+- Scroll to change." ;;
+ 6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
+esac
+
+vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
+
+# If muted, print 🔇 and exit.
+[ "$vol" != "${vol%\[MUTED\]}" ] && echo 🔇 && exit
+
+vol="${vol#Volume: }"
+
+split() {
+ # For ommiting the . without calling and external program.
+ IFS=$2
+ set -- $1
+ printf '%s' "$@"
+}
+
+vol="$(printf "%.0f" "$(split "$vol" ".")")"
+
+case 1 in
+ $((vol >= 70)) ) icon="🔊" ;;
+ $((vol >= 30)) ) icon="🔉" ;;
+ $((vol >= 1)) ) icon="🔈" ;;
+ * ) echo 🔇 && exit ;;
+esac
+
+echo "$icon$vol%"