Is there a way to swap what button is showing on hold?

So I have a time widget on the left of my Touch Bar, and I was wondering if there was a way that, when I hold the timer widget, it swaps to a battery widget. Is this possible? maybe with some code that Command + Ds the time widget, then Command Ds the hidden batter widget (and obviously vice versa)?