RE: what 'user' are acpi scripts run as? Forcing DCOP to lookatcurrent user? (SOLVED)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
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!



<<winmail.dat>>


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux