Dynamic Button List

Is there a way to create dynamic Buttons?
I want to have a python or JS script that calculates a list of not responding processes
and I want to swipe through them on the Touch Bar
and when I press them to kill that process or something like that