This is the script I used, you can replace "cava" with whatever application you want running, cava is just a terminal music visualizer I like: (you need xdotool and urxvt for it)
#!/bin/bash
urxvt -embed $(xwininfo -root | awk 'FNR == 2 {print $4}') --override-redirect -bg [0]#000 -e "cava" &
sleep 1 && xdo lower $(xwininfo -name "cava"| awk 'FNR == 2 {print $4}')