Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-02-2005, 05:10 AM   #1
LQ Newbie
Registered: Aug 2005
Distribution: Redhat/Fedora
Posts: 2

Rep: Reputation: 0
How to start my GUI program by a daemon?


This is Chunhao, I need your help on my problem below:

I wrote a daemon named "key_captured", which is used to catch
some special key presses of Sony Vaio notebook, for instance, when
I press the "DVD" on the keyboard, the daemon will call the media
player "kaffeine", and if I press "Fn + F7", the daemon will show a
GUI named "display_switch", written with Qt by me.

I made a symbolic link of "key_captured" with the command:
#ln -s /usr/sbin/key_captured /root/.kde/Autostart/
so that this daemon starts automatically each time when X starts
(I'm using KDE). I find that this method can work fairly well,
"key_captured" can catch my key press and call the corresponding
GUI applications.

But now, for some reason, I need to add my "key_captured" into
system services to start the daemon automatically, instead of the
method by symbolic link. I find If the daemon is started by system
services, it can NOT catch my key presses under X-Window. I do not
know the exact reason, maybe there is some bug in my daemon
"key_captured", I'm using:
system("kaffeine &");
system("display_switch &");
to execute the GUI programs.

Would you please give me some suggestion on how to solving this
program? Should I use "fork"-like system calls to produce the GUI
process, and make it the child process of X?

Best Regards
Old 08-02-2005, 05:23 AM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,896

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Try putting your scripts in /home/<username>/.kde/Autostart. Then see what happens when you reboot.
Old 08-02-2005, 05:41 AM   #3
LQ Newbie
Registered: Aug 2005
Distribution: Redhat/Fedora
Posts: 2

Original Poster
Rep: Reputation: 0
I have tried this method, it can work. but this time I want to use another method,
which is start the daemon as system services, It does NOT work.
Old 08-05-2005, 03:04 PM   #4
Registered: Sep 2003
Location: Germany/BW
Distribution: My own
Posts: 235

Rep: Reputation: 21
What I find out, is that kde has it's own scheduler, so the linux-system and kde-system are separated.
I'm looking for something similar like you want to do. Kde has mime-types for execution. So make a kde-link to your bin or whatever with the needed kde-rules maybe that works. Oh.. is KDE started before execution? only if you get an error like no connection to x-server you'r out of the KDE-system.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start a daemon/program at boot SchwipSchwap Linux - Newbie 15 01-24-2006 02:58 AM
good ftp daemon with gui gejoroni Linux - Software 4 09-27-2005 08:02 AM
start gui based program after user login shahidawan Linux - General 9 07-27-2005 09:46 PM
Start program in daemon mode from cgi-bin Xa! Programming 1 12-01-2004 12:00 AM
is there a irc daemon that has GUI? im using RH8 can someone help? thanks ;) kublador Linux - Software 5 05-29-2003 02:56 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:24 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration