So I'm writing aliases so that I can start/stop pulseaudio for the purpose of running some Wine apps. My aliases currently look like:
# Reload pulse audio devices
alias rldpulsdev='sudo service avahi-daemon restart'
#Wine needs to use ALSA directly. PulseAudio interferes with it.
#kill pulseaudio
alias kpa='echo "autospawn = no" > ~/.config/pulse/client.conf;sudo service pulseaudio stop'
#start pulseaudio
alias spa='echo "autospawn = yes" > ~/.config/pulse/client.conf;sudo service pulseaudio start;rldpulsdev'
Problem: If I kill pulseaudio using the above alias, all of the devices disappear from the sound management widget and the speaker icon disappears from the tray. That's OK for when pulse is off but I want the start alias to fix this. The "rldpulsdev" alias above is part of the puzzle but I'm definitely still missing something. Clue please? If I fiddle around with it and maybe restart or relog, it fixes itself eventually but this in itself implies there's something I can do to fix it from an alias.