aboutsummaryrefslogtreecommitdiff
path: root/ztunekey
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-04 04:15:53 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-04 04:15:53 -0400
commit9e75e94fbb174b7a030276fc73e8703b08405c6c (patch)
treeca1bef019057fad71351e27a21012584a4306243 /ztunekey
parent70b04c7f89fce8a94b8af8a6beb58033d5424634 (diff)
downloadmisc-scripts-9e75e94fbb174b7a030276fc73e8703b08405c6c.tar.gz
find_key, find_tuning: add -q (quiet); ztunekey: added (GUI wrapper for find_key and find_tuning).
Diffstat (limited to 'ztunekey')
-rwxr-xr-xztunekey33
1 files changed, 33 insertions, 0 deletions
diff --git a/ztunekey b/ztunekey
new file mode 100755
index 0000000..da69d56
--- /dev/null
+++ b/ztunekey
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+# icon from:
+# https://vectorified.com/images/guitar-tuner-icon-28.jpg
+# ...installed via:
+# convert guitar-tuner-icon-28.jpg .local/share/icons/hicolor/256x256/apps/ztunekey.png
+
+ICON=ztunekey
+ZOPT='--width 300 --height 100 --title Tuning/Key'
+file="$1"
+
+if [ "$file" = "" ]; then
+ file="$( audtool --current-song-filename )"
+ if [ "$file" = "" ]; then
+ zenity --error $ZOPT --text="No song is playing!"
+ exit 1
+ fi
+fi
+
+if [ ! -e "$file" ]; then
+ zenity --error $ZOPT --text="No such file: $file"
+ exit 1
+fi
+
+bn="$( basename "$file" )"
+
+( find_tuning -q "$file" > /tmp/tuning.$$ &
+ find_key -q "$file" > /tmp/key.$$ &
+ wait ) | zenity --progress $ZOPT --icon-name=ztunekey --text="$bn" --pulsate --auto-close
+
+zenity --info $ZOPT --icon-name=ztunekey --text="$bn Tuning: $( cat /tmp/tuning.$$ ) cents Key: $( cat /tmp/key.$$ )"
+
+rm -f /tmp/tuning.$$ /tmp/key.$$