diff --git a/scripts/check_mail.sh b/scripts/check_mail.sh new file mode 100755 index 0000000..57d726b --- /dev/null +++ b/scripts/check_mail.sh @@ -0,0 +1,8 @@ +#!/bin/sh +maildirs="$HOME/Mail/magazino/INBOX/new/" +ml="$(find "$maildirs" -type f | wc -l)" +if [ $ml > 0 ]; then + echo "$ml" +else + echo "0" +fi diff --git a/scripts/pulseaudio-tail.sh b/scripts/pulseaudio-tail.sh new file mode 100755 index 0000000..107adf6 --- /dev/null +++ b/scripts/pulseaudio-tail.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +sink=$(pactl list sinks | grep -B 1 RUNNING | head -n1 | sed 's/[A-Za-z# ]*//') + +volume_print() { + + muted=$(~/src/pamixer/pamixer --sink $sink --get-mute) + + if [ "$muted" = true ]; then + echo "$sink --" + else + echo "$sink $(~/src/pamixer/pamixer --sink $sink --get-volume)" + fi +} + +volume_up() { + pactl set-sink-volume $sink +1% +} + +volume_down() { + pactl set-sink-volume $sink -1% +} + +volume_mute() { + pactl set-sink-mute $sink toggle +} + +listen() { + volume_print + + pactl subscribe | while read -r event; do + if echo "$event" | grep -q "#$sink"; then + volume_print + fi + done +} + +case "$1" in + --up) + volume_up + ;; + --down) + volume_down + ;; + --mute) + volume_mute + ;; + *) + listen + ;; +esac