It isn't exactly what you have in mind, but I use `play` as well as a terminal theme color change to tell me when I'm using one or another language's keyboard layout. If you put & in front of play, you can make chords. Here's an example: # Define notes for major seventh chord starting on A 440 A=440 C_SHARP=554.37 E=659.25 G_SHARP=830.61 if [[ "$layout" == "Finnish" ]]; then # Play a major seventh chord ascending kit…
# Define notes for major seventh chord starting on A 440
A=440
C_SHARP=554.37
E=659.25
G_SHARP=830.61
case "$layout" in
Finnish)
kitty +kitten themes --reload-in=all Apprentice &
play "|sox -np synth 0.2 sine $A" \
"|sox -np synth 0.2 sine $C_SHARP" \
"|sox -np synth 0.2 sine $E" \
"|sox -np synth 0.2 sine $G_SHARP" \
vol -30dB 2>&- &
;;
'English (US)')
kitty +kitten themes --reload-in=all Default &
play "|sox -np synth 0.2 sine $G_SHARP" \
"|sox -np synth 0.2 sine $E" \
"|sox -np synth 0.2 sine $C_SHARP" \
"|sox -np synth 0.2 sine $A" \
vol -30dB 2>&- &
;;
*) echo >&2 'Invalid $layout - must be "Finnish" or "English (US)"'; exit 1
esac