Hi
I had the same problem and solved it with single command run in the terminal:
Code: Select all
pactl load-module module-switch-on-connect
and it worked like charm, but it was not persistent,
after reboot I needed to run the same command every time. I tried different solutions from forums around, but nothing worked.
I spend 5-6 hours and grabbing peaces from those forums - I solved it:
1. I created a shell script with that command above:
Code: Select all
#!/bin/sh
sleep 12s
pactl load-module module-switch-on-connect
exit 0
2. Saved it as "auto-switch-nk.sh" in "~/.config" folder (you can save it in your home folder if you want)
3. I used "Sessions and Startup" tool to create auto start entry:
4. On tab "Application Autostart" click "+Add" button
5. Fill the fields as below:
Name: auto-switch
Description: <put whatever you want here>
Command: - I clicked the folder icon along this field and indicated to that shell script above in ".config" folder
Trigger: on login
-- after reboot it did not work, then I:
4. opened the the file that "Sessions and Startup" created for me "nano ~/.config/autostart/auto-switch-nk.desktop"
5. Added "sh" right after "Exec=" on line 7. (if it's there in your case - just ignore this)
This is what the file "auto-switch-nk.desktop" looked like eventually:
Code: Select all
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=auto-switch-nk
Comment=Auto switch to bluetooth headphones
Exec=sh /home/USER_NAME/.config/auto-switch-nk.sh
OnlyShowIn=XFCE;
RunHook=0
StartupNotify=false
Terminal=false
Hidden=false
!! Don't forget to replace "USER_NAME" with your actual username in the field above
After reboot - I have it working.
Hope this helps =)