How to script adding ‘Show Desktop Button’

Have a look here Automate panel customizations