aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-15 16:46:00 -0300
committerEuAndreh <eu@euandre.org>2023-03-15 16:46:00 -0300
commit0de8894f874b9ee2ed48c7113a3eda4333a3aed4 (patch)
treee7c7b7a7c209e474199c293f7013e4dc19356228 /bin
parentMakefile: Add username@ to subject on "check-aliases" (diff)
downloaddotfiles-0de8894f874b9ee2ed48c7113a3eda4333a3aed4.tar.gz
dotfiles-0de8894f874b9ee2ed48c7113a3eda4333a3aed4.tar.xz
bin/boop: Add -n option
Diffstat (limited to 'bin')
-rwxr-xr-xbin/boop11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/boop b/bin/boop
index a7792b3..23d1ed4 100755
--- a/bin/boop
+++ b/bin/boop
@@ -3,7 +3,7 @@ set -eu
usage() {
cat <<-'EOF'
- boop [-m MESSAGE] -- COMMAND...
+ boop [-m MESSAGE] [-n] -- COMMAND...
boop -h
EOF
}
@@ -14,6 +14,7 @@ help() {
Options:
-m MESSAGE text message of the desktop
notification (default: COMMAND)
+ -n don't play any sound
-h, --help show this message
COMMAND the commands to be executed
@@ -47,11 +48,15 @@ for flag in "$@"; do
esac
done
-while getopts 'm:h' flag; do
+SOUND=-s
+while getopts 'm:nh' flag; do
case "$flag" in
m)
MESSAGE="$OPTARG"
;;
+ n)
+ SOUND=
+ ;;
h)
usage
help
@@ -78,6 +83,6 @@ else
fi
CMD="$*"
-msg -"$N" -bs -D "${MESSAGE:-$CMD}"
+msg -"$N" -b $SOUND -D "${MESSAGE:-$CMD}"
exit "$STATUS"