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.

2 Likes
#!/bin/bash
if pgrep -f "/home/eid/app" > /dev/null
then
    # The application is running, so let's kill it
    pkill -f "/home/eid/app"
else
    # The application is not running, so let's start it
    /home/eid/app &
fi

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.