thanks Babs!
it partly works.
For me is enough run command:
systemctl --user start pulseaudio
and headphones stay connected after conecting
but I must run it after each computer restart... so I want do it automatically
after switching on command:
systemctl --user status pulseaudio
● pulseaudio.service - Sound Service
Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; enabled; preset: enabled)
Active: active (running) since Tue 2023-07-18 16:05:23 CEST; 5s ago
TriggeredBy: ● pulseaudio.socket
Main PID: 3140 (pulseaudio)
Tasks: 4 (limit: 9248)
Memory: 11.5M
CPU: 183ms
CGroup: /user.slice/user-1000.slice/[email protected]/session.slice/pulseaudio.service
└─3140 /usr/bin/pulseaudio --daemonize=no --log-target=journal
čec 18 16:05:22 lenovo-xubuntu-22-04 systemd[2074]: Starting pulseaudio.service - Sound Service...
čec 18 16:05:22 lenovo-xubuntu-22-04 pulseaudio[3140]: Stale PID file, overwriting.
čec 18 16:05:23 lenovo-xubuntu-22-04 systemd[2074]: Started pulseaudio.service - Sound Service.
čec 18 16:05:23 lenovo-xubuntu-22-04 pulseaudio[3140]: Could not find org.bluez.BatteryProviderManager1.RegisterBatteryProvider(), is bl>
lines 1-15/15 (END)
So I want run it automatically. I have created file ~/.local/share/systemd/user/sluchatkaBT.service
with content:
[Unit]
Description=startuje pulseaudio
[Service]
ExecStart=pulseaudio
[Install]
WantedBy=multi-user.target
but when after next restart computer:
systemctl --user status sluchatkaBT.service
○ sluchatkaBT.service - startuje pulseaudio
Loaded: loaded (/home/fik236/.local/share/systemd/user/sluchatkaBT.service; enabled; preset: enabled)
Active: inactive (dead)
and
systemctl --user status pulseaudio
○ pulseaudio.service - Sound Service
Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; enabled; preset: enabled)
Active: inactive (dead)
TriggeredBy: ○ pulseaudio.socket
and headphones are again after conecting disconnected
please colud anybody helps me what is wrong?