Closed Ao1Pointblank closed 1 year ago
Aha! I got what I needed by using a 1-line command instead of a script file. But is there a way {app}, {title} and {body} can be passed through an external script?
a2ln --pairing-port 46351 --title-format "{app} | {title}" 46352 --command 'if [ -f ~/.sounds/a2ln/{app}.mp3 ]; then play -q ~/.sounds/a2ln/{app}.mp3; else play -q ~/.sounds/a2ln/default_notif.mp3; fi'
Hey, thanks for the issue.
You can pass the app's name as an argument to the script.
#!/bin/bash
app=$1
if [ -f "~/.sounds/a2ln/${app}.mp3" ]; then
play -q "~/.sounds/a2ln/${app}.mp3"
else
play -q "~/.sounds/a2ln/default_notif.mp3"
fi
a2ln --pairing-port 46351 --title-format "{app} | {title}" 46352 --command "bash -c ~/.sounds/a2ln/a2ln_app_sounds.sh {app}"
How can I pass the {app} variable to this script, in order to play custom sounds with each app's notifications?
• _a2ln_appsounds.sh:
executed by:
a2ln --pairing-port 46351 --title-format "{app} | {title}" 46352 --command "bash -c ~/.sounds/a2ln/a2ln_app_sounds.sh"