change process name in gtkdialog

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
hannysabbagh
Posts: 17
Joined: Sun 14 Apr 2013, 10:34

change process name in gtkdialog

#1 Post by hannysabbagh »

Hello.

I wonder if there is a way to change process name for my gtkdialog apps?
i mean when i write an app using gtkdialog, and when i run this app, the process name is always "gtkdialog", can i change this??

thanks.

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#2 Post by akash_rawal »

Use 'title' tag attribute to <window> tag. e.g.

Code: Select all

<window title="some other title">
...
</window>
For other uses http://code.google.com/p/gtkdialog/ can be helpful.

hannysabbagh
Posts: 17
Joined: Sun 14 Apr 2013, 10:34

#3 Post by hannysabbagh »

Thank you.

but this only changes the window title, i want to change the process name so i can run 'killall' on the window i want, not all gtkdialog windows.

thanks.

akash_rawal
Posts: 229
Joined: Wed 25 Aug 2010, 15:38
Location: ISM Dhanbad, Jharkhand, India

#4 Post by akash_rawal »

There are two ways of doing it.
1. Start gtkdialog asynchronously and record its process id. Later kill it with its process id like:

Code: Select all

gtkdialog -p EXAMPLE & #<< Note the '&' at the end
pidof_dialog="$!" #To record process ID into pidof_dialog
wait "$pidof_dialog" #To suspend execution till gtkdialog ends, optional
...
#later
kill "$pidof_dialog"
2. Symlink the gtkdialog executable and give it another name.

Code: Select all

ln -sT "`which gtkdialog`" /tmp/my_gtkdialog
/tmp/my_gtkdialog -p EXAMPLE
...
#later
killall my_gtkdialog

Post Reply