what 'user' are acpi scripts run as? Forcing DCOP to lookatcurrent user? (SOLVED)
Birt, Jeffrey
birtj at umr.edu
Tue May 3 03:45:03 UTC 2005
Dave Mitchell wrote:
>I presume you meant
>
> system "su birtj -c '/etc/acpi/actions/perl_dcop.pl false'";
>
> Jeff Birt wrote:
>Thanks Dave, You are of course correct. I have found that when using
>dcop from a console window with su -c it has to be like this.
>
>su -c 'dcop kdesktop KScreensaverIface enable false' birtj
>
>Still, either method works if the acpi script is called from a root
>console window but not when the acpi script is called from the 'system'.
>
>The 'system' is out to get me man! ;'>
OK, thanks to eveyones help I got this going. The problem turned out to be the single quotes embeded in a double quoted string. I changed them to escaped double quotes and all was well. New version is:
# Manage the backlight. If lid is open, turn the screen and kscreensaver on.
# If the lid is closed, turn off screen and kscreensaver. This allows the
# laptop to be docked with the screen and kscreensaver off while connected
# via a metaVNC session to my desktop machine. If one were using an external
# monitor with the docking station instead of a vnc connection turning off the
# screensaver probably not be desireable.
# Operation: su is used to call perl_dcop.pl. This is nessecary as perl_dcop
# calls a kdesktop dcop interface to control the screensaver and dcop must be
# from the user whose applications you are trying to interface with. The
# escaped double quotes \" were needed so perl would pass the entire argument
# to the system.
if ($will_sleep==0 && $device eq "LID") {
if ($lid_state eq "open") { # reopening.
backlight "on";
system "su birtj -c \"/etc/acpi/actions/perl_dcop.pl true\" ";
} elsif ($lid_state eq "closed") { #closing.
backlight "off";
system "su birtj -c \"/etc/acpi/actions/perl_dcop.pl false\" ";
}
}
Thanks again!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3642 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20050502/d7686726/attachment-0001.bin>
More information about the fedora-list
mailing list