this is related to... [https://unix.stackexchange.com/questions/25776/detecting-headphone-connection-disconnection-in-linux][1]
as the title states, I wanted to switch pulseffects profiles on headphone connection/disconnection. I've referred to the link below for setting profiles via the terminal but these do not work on the pulseeffects flatpack.
after a bit of googling, I figured out that i could
use, flatpak run com.github.wwmm.pulseeffects -l <profilename>
to change the profile as necessary.
I assume that I'll have to use acpid to execute the aforementioned on jack/headphone plug/unplug events. https://linux.die.net/man/8/acpid. Later, I found this link.
How do I actually write acpid event scripts that detect when headphones are plugged in?
...and have now created two events
headphone-jack-plug
event=jack/headphone HEADPHONE plug
action=/etc/acpi/headphone-jack.sh plug
headphone-jack-unplug
event=jack/headphone HEADPHONE unplug
action=/etc/acpi/headphone-jack.sh unplug
the script, however exits with status 1 on running sudo journalctl -u acpid -f
for both events.
#!/bin/sh
if [ "$1" = plug ]; then
flatpak run com.github.wwmm.pulseeffects -l HdPhDlbCnv
elif [ "$1" = unplug ]; then
flatpak run com.github.wwmm.pulseeffects -l DolbConv
fi
on redirecting the error to a file i see...
error: app/com.github.wwmm.pulseeffects/x86_64/master not installed
but running the flatpak command in a terminal works... how do i fix this?