#!/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.$$