PDA

View Full Version : detecting Idle Activity ?



nupul
2nd April 2006, 14:38
w.r.t X11

I wish to detect an idle-activity...(i.e The system is idle for sometime viz 2 mins) and launch a 'filler' program of my choice <-- how do I detect such an event?

Also, when the user resumes after sometime (more than 2mins) I wish to display his login Id and ask for his password...removing the 'filler' program only when the password is correct? <-- Can I achieve this via Qt4??

Thanks

Nupul

SkripT
2nd April 2006, 14:42
You have to use a QTimer, activating or stopping it when you need.

jpn
2nd April 2006, 14:49
http://www.qtcentre.org/forum/showthread.php?t=1464

nupul
3rd April 2006, 05:20
well the detecting idle-activity answer is found, but what about the latter part of my query...that is equally important for me!!!

Thanks

Nupul

wysota
3rd April 2006, 19:49
As (almost) always, the answer is "it depends". Using Qt only? No. You have to at least use pam or some other interface to system authorisation mechanisms. If you have specific problems, ask specific questions. For general problems you're likely to hear "it depends" (or not hear anything at all) quite often.

jacek
3rd April 2006, 20:16
What password and id? Do you mean those you use to log into the OS? If yes, then why do you want to reinvent the wheel? Just configure your system properly.

wysota
3rd April 2006, 20:56
What password and id? Do you mean those you use to log into the OS? If yes, then why do you want to reinvent the wheel? Just configure your system properly.

He is making a window manager as his project (academic, I guess), so he wants to reimplement KDE in a weekend ;)

nupul
4th April 2006, 12:24
What password and id? Do you mean those you use to log into the OS? If
yes, then why do you want to reinvent the wheel? Just configure your
system properly.


Yes, the one to log into the OS...I don't wish to reinvent the wheel, i just didn't know about what else i needed to use...wysota in his previous reply told me to use some other interface to system authorisation mechanisms...That's the main thing i wanted to clarify...that Qt alone will not suffice. --- should have clarified this earlier...sorry for that.



He is making a window manager as his project (academic, I guess)


Correction...I am implementing a Desktop manager, capable of working with any window manager.

Academic=True; ;)



...so he wants to reimplement KDE in a weekend


[I]Ghosh, I wish... :rolleyes:

As for providing a 'screen locking mechanism' like KDE, I feel it quite apt for any desktop manager to have one...and thus am trying to implement the same...

I planned to emulate the MAC GUI, but the time constraint forced me to keep it simple till it's submission...I will be modifying it to the desired level after mastering Qt till a good extent!

As KDE is developed with Qt, It helps me gain a better understanding of the toolkit, thus helping me realise what i need to and don't need to ;) implement (i.e go to the level of Xlib) for my project...for that the online KDE-source-code reference, Qt doc and you guys @ Qtcentre have been monumental in clarifying my doubts...and helping me better understand my mistakes etc.

Thanks!!!!!!!!!!!!!!!!!!!!!!!

:)

Nupul.

wysota
4th April 2006, 13:53
Correction...I am implementing a Desktop manager, capable of working with any window manager.
And how do you understand the difference between the two?

nupul
5th April 2006, 07:51
And how do you understand the difference between the two?

Well a window manager (WM) lays out the policy of HOW the windows are to displayed on the screen, the decoration of the window frame, the title bar and the layout of the control buttons viz. maximise, minimize etc.

eg. In window maker, you don't have a maximize button...only a close (top right) and minimize (top left).

Thus a WM just allocates the screen resource as requested by the app.

Now you know that there are a plethora of WMs available...each with its own styles etc...(eg: you can set the background in window maker, but can't do that in kwin or metacity) A desktop manager (DM) is a layer on top of the WM. It's job is to make the user interface look consistent...irrespective of the underlying window manager

The following are a part of any DM:

1. panel/taskbar
2. file manager
3. the desktop screen
4. Themes
5. Control panel interface

Themes may lead to ambiguity...as in if a WM also supports themes and the DM themes are also set...which one should be applied??

The rest are all apps which can be invoked individually....but...why should one...when a DM provides for the same.

KDE uses Kwin as its underlying WM...if you have fvwm the on the prompt type:


$: fvwm --replace

to see how fvwm handles the windows or kill the existing wm and pipe it with some other to see how KDE works with different WMs and how they (WMs) manage the windows set forth by KDE



$: kill <pid of kwin>|metacity ....or any WM that you have

or start X in failsafe and do the following:


$: wmaker & (or $: kwin & to start kwin...will surely be present on system!)
$: kde &

to see start kde with wmaker as it's underlying base..

You could do the changes in 'startkde' file but the above experimentation helps you easily understand the difference. :)

Nupul