It doesn't make sense to duplicate efforts. Please use the Window Title Applet, which is better integrated with Latte Dock technology: https://github.com/psifidotos/applet-window-title
KDE plasma applet to show the active application name. Thought to be used in a panel together with plasma's global menu.
Unfortunately AWC does not seem to be maintained anymore. The experience from the official plasma global menu is currently better, but it is currently missing the active application name.
Git:
git clone https://github.com/kupiqu/plasma-active-application
plasmapkg2 -i .
plasmapkg2 -u .
plasmapkg2 -r org.kde.activeApplication
Strongly based on AWC