Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 22 Sep 2014, 22:31
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
change process name in gtkdialog
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
hannysabbagh

Joined: 14 Apr 2013
Posts: 17

PostPosted: Sat 25 May 2013, 03:30    Post subject:  change process name in gtkdialog  

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.
Back to top
View user's profile Send private message 
akash_rawal

Joined: 25 Aug 2010
Posts: 232
Location: ISM Dhanbad, Jharkhand, India

PostPosted: Sat 25 May 2013, 04:41    Post subject:  

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

<window title="some other title">
...
</window>

For other uses http://code.google.com/p/gtkdialog/ can be helpful.
Back to top
View user's profile Send private message 
hannysabbagh

Joined: 14 Apr 2013
Posts: 17

PostPosted: Sat 25 May 2013, 04:48    Post subject:  

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.
Back to top
View user's profile Send private message 
akash_rawal

Joined: 25 Aug 2010
Posts: 232
Location: ISM Dhanbad, Jharkhand, India

PostPosted: Sat 25 May 2013, 07:31    Post subject:  

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:

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:

ln -sT "`which gtkdialog`" /tmp/my_gtkdialog
/tmp/my_gtkdialog -p EXAMPLE
...
#later
killall my_gtkdialog
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0531s ][ Queries: 12 (0.0152s) ][ GZIP on ]