Hi all,
A recent trip to another distro showed me that my Bluetooth headphones connected and were auto-selected.
Back in MX, which is so much better in many other ways... I have to manually select the headphones in the sound option every time I connect them. If I don't, the sound comes out of the laptop.
Is there a way to automate the switch in MX?
Thanks
Auto switch to bluetooth headphones
- RallyDarkstrike
- Posts: 151
- Joined: Fri Jan 22, 2021 1:51 pm
Re: Auto switch to bluetooth headphones
Seconding this as I only realized and found out about this last night....
Running Linux Mint MATE on my Lenovo Thinkpad T520, the second I connect my JVC Bluetooth headphones, the audio is happily transferred over automatically, but I was stumped for a second at first when I tried it on my HP Stream last night with the same headphones and the noise kept coming out of the speakers!
Running Linux Mint MATE on my Lenovo Thinkpad T520, the second I connect my JVC Bluetooth headphones, the audio is happily transferred over automatically, but I was stumped for a second at first when I tried it on my HP Stream last night with the same headphones and the noise kept coming out of the speakers!
- Eadwine Rose
- Administrator
- Posts: 14756
- Joined: Wed Jul 12, 2006 2:10 am
Re: Auto switch to bluetooth headphones
Please share your full Quick System Info, found in the menu. Press the Copy for forum button, then click paste in a reply.. thanks.
Oh.. I thought a post by a new person was asking for help. *chuckles*
Oh.. I thought a post by a new person was asking for help. *chuckles*
MX-23.6_x64 July 31 2023 * 6.1.0-37amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030
Re: Auto switch to bluetooth headphones
Hi
I had the same problem and solved it with single command run in the terminal: 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:
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:
!! Don't forget to replace "USER_NAME" with your actual username in the field above
After reboot - I have it working.
Hope this helps =)
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
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
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
After reboot - I have it working.
Hope this helps =)
Re: Auto switch to bluetooth headphones
Ohh, I am sorry, My post is duplicated, I messed with "Preview and Submit" buttons.
Please just remove the top one, I guess the lower post is shorter and more understandable.
Thanks
Please just remove the top one, I guess the lower post is shorter and more understandable.
Thanks
- Eadwine Rose
- Administrator
- Posts: 14756
- Joined: Wed Jul 12, 2006 2:10 am
Re: Auto switch to bluetooth headphones
Done. Hope I removed the one you intended to go :)
MX-23.6_x64 July 31 2023 * 6.1.0-37amd64 ext4 Xfce 4.20.0 * 8-core AMD Ryzen 7 2700
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030
Asus TUF B450-Plus Gaming UEFI * Asus GTX 1050 Ti Nvidia 535.247.01 * 2x16Gb DDR4 2666 Kingston HyperX Predator
Samsung 870EVO * Samsung S24D330 & P2250 * HP Envy 5030
Re: Auto switch to bluetooth headphones
Thanks
yes, you removed the one I intended.
I did not find that post (78678) to follow before I managed it my way =)
I've just looked into the file:
Or the guy miss spelled it or the config file changed since then.
I could not find any:
in that file , but I think he means this part/block of the file:
yes, you removed the one I intended.
I did not find that post (78678) to follow before I managed it my way =)
I've just looked into the file:
Code: Select all
/usr/share/pipewire/pipewire-pulse.conf
I could not find any:
Code: Select all
content.exec:
Code: Select all
context.exec = [
{ path = "pactl" args = "load-module module-always-sink" }
{ path = "pactl" args = "upload-sample my-sample.wav my-sample" }
{ path = "/usr/bin/sh" args = "~/.config/pipewire/default.pw" }