Can we create toggle launcher?

I want to create launcher , that launcher for open or run command and i want when i click it again for second time , i want it to kill the command.

Using alt+F2 operates as an open command or launcher.
I use xkill linked to ctl+x as the kill command.

if pgrep -f "/home/eid/app" > /dev/null
    # The application is running, so let's kill it
    pkill -f "/home/eid/app"
    # The application is not running, so let's start it
    /home/eid/app &

i found that script and it worked good

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.