There's really only one way to do what you suggest and that's to feed the TV with your HDMI out of your Mac mini and the TV in turn will send a digital signal to the sound bar via the optical connection. This way, in effect the TV becomes your source switch.
There's no value in adding an external DAC to your current setup. Relax, sit back and enjoy some very convenient Flac streaming! I'm a streaming maniac with now every room having audio available......even the master bath with a pair of Martin Logan in ceiling speakers.
i am not that familiar with sound bars in general but assumed they were a variation of a powered speaker and therefore would have analog inputs. If that is the case then I would again suggest an external DAC. would provide a significant improvement over direct output from the Mac Mini. Of course all I have is my own personal experience which cannot encompass all the experience, opinions and preferences of the many