View Single Post
Mikkosssss's Avatar
Posts: 645 | Thanked: 519 times | Joined on Apr 2012 @ Finland
#14
Originally Posted by thedead1440 View Post
Mikkosssss,

In your exec field you can have it as Exec=/home/user/kill.sh

with kill.sh contents being:

Code:
#!/bin/sh

1=cutetube
2=openvideoplayer
3=fennec

if ps -ae | grep -v grep | grep "$1" > /dev/null
then
kill `pgrep -f "$1"`
fi
if ps -ae | grep -v grep | grep "$2" > /dev/null
then
kill `pgrep -f "$2"`
fi
if ps -ae | grep -v grep | grep "$3" > /dev/null
then
kill `pgrep -f "$3"`
fi
Of course use top to check if those are the process names exactly first
I got it working with desktop file.

But if theres way to add message displayed on script I will use script.