0

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.

https://askubuntu.com/questions/1200332/how-can-i-toggle-selected-pulseeffects-equalizer-profile-from-command-line

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?

1 Answer 1

2

I found an easier solution to achieve this:

Create a preset where all plugins are disabled. Let's say that you call it none like in the image below enter image description here

While the headphones are plugged in click on the middle button with a curved arrows icon. This is the preset autoloading button. As long as it is activated while the target device is selected as default the corresponding preset should be automatically loaded whenever this device becomes the default again.

Source

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .