[PLUG] Run a simple script at KDE startup

Denis Heidtmann denish at dslnorthwest.net
Wed Dec 13 05:17:32 UTC 2006


Paul Mullen wrote:
> On Tue, Dec 12, 2006 at 05:01:09PM -0800, Denis Heidtmann wrote:
>> I edited kcmdisplayrc using Kate, (invoked with kdesu).  Then I
>> logged out and logged back in. Is this a problem?
> 
> My suspicion (untested) is that KDE would re-write kcmdisplayrc upon
> logout, leaving the file's contents the way it thinks they should be.
> Have you checked kcmdisplayrc again since you logged out and back in,
> just to verify that it's still the way you set it? If you really
> wanted to hand-edit kcmdisplayrc, you would probably have to do it
> while there is no KDE session running, in order to avoid having KDE
> step all over your changes.

The kcmdisplayrc changes have stuck.
> 
>> The values reported by xset do not match the values in kcmdisplayrc.
>> To do so, they should be 60,120,180 seconds.  Where do 20, 30, and
>> 40 minutes come from?
> 
> Probably the values that are set via KDE.

Now I check xset q (after a long idle time and a reboot) I see:

DPMS (Energy Star):
   Standby: 60    Suspend: 0    Off: 0
   DPMS is Enabled
   Monitor is On

However, if I end the current session, and then log on again, I get:

DPMS (Energy Star):
   Standby: 1200    Suspend: 1800    Off: 2400
   DPMS is Enabled
   Monitor is On

A second session end and re-logon results in the same report from xset  q.

This is the bug that others had talked about, I suspect. Some had reported 
increases on-going with each new log-in.

> 
>> Using Systemsettings (the replacement for kcontrol) gives me only
>> one time option, and as a result, sends the command xset dpms 60 60
>> 60 (for a 1 minute time).
> 
> System Settings is an Ubuntu thing, IIRC? I'm not sure why it doesn't
> offer the full complement of display power management settings. Can
> you still right-click on the desktop and get to the "Configure
> Desktop..." control panel? On my system, the "Display" section of that
> control panel has a "Power Control" tab with options for standby,
> suspend, and power-off.

No power options are offered with a right click -> Configure Desktop.  The 
closest it comes is screen saver options.  I have never run Ubuntu, only Kbuntu, 
but they have quit a bit in common, AFAIK.

> 
>> If I execute sudo kcontrol from a termminal window, I get errors,
>> and no access to monitor power:
> 
> You should be able to run kcontrol as a regular (non-root) user. If a
> particular panel requires root privileges, it'll ask for the password.
> 
Yes, you are correct.  But the display -> power saving tab only offers one time, 
and it is set to 30 minutes (right now).  It could be that some helpful KDE 
programmer decided offering three times was too confusing for the likes of me, 
and just added and subtracted 10 minutes to get the other two times.  When I 
select something under 10 minutes, the planned simplification breaks. (In this 
test I did not make any changes, as I did not want kcmdisplayrc to get changed. 
BTW, I understand that Systemsettings combines kcontrol and some other things to 
put them all in one place.

parents at R2D2:~$ kcontrol
parents at R2D2:~$

Pythonize constructor -- pid = 5512
Python interpreter initialized!

Pythonize constructor -- pid = 5512
open /dev/mem: Permission denied
VESA BIOS Extensions not detected.
ScimInputContextPlugin()


>> Pythonize constructor -- pid = 4788
>> Xlib: connection to ":0.0" refused by server
>> Xlib: No protocol specified
> 
> It's dying because root cannot (without some trickery) run GUI-based
> apps on a display belonging to a regular user's login. Just hit F2 and
> run 'kcontrol' like any other app.
> 
Perhaps, but my reading of the kdesu man page leads me to believe that it 
provides the trickery.  But no matter. it is not needed in this case.

I still think my best bet is to put xset dpms 120 180 300 (or whatever) in a 
script which runs after KDE has been run. (now that I have Option dpms set).  So 
where does it go, and how must it be named to do its thing?

This whole thing has been an education.  (The upside of unresolved bugs?)

Thanks again,

-Denis






More information about the PLUG mailing list