View Single Post
Posts: 669 | Thanked: 433 times | Joined on May 2010
#27
Originally Posted by vi_ View Post
Next steps finish script, hook it into dbus-scripts. That will have to wait till I am not at work though! XD
Thanks for the help man - issues 1 and 2 solved now - I use the following script:

#!/bin/sh

video_cable=$(lshal | grep 'line-out.*video-out')

if [[ "$video_cable" != "" ]]; then
[code]…
fi
else
[code]…
fi
fi

About issue 3 - I've already found many cases for commands that are not working when they are launched in a script that is being launched by dbus events.
One command makes a mouse cursor to show up or hide "/usr/bin/xsetroot.azerty1". It works fine from terminal, but when inside such a script it just does nothing - it's like its line of execution is skipped (commands before and after it in the same script are working fine)

I had the same behavior for these commands in other scripts (all are tested and working when executed from x-term):

Changing profile:
dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"silent"

Disconnecting (or connecting) from IM account:
mc-tool list | grep [my user name] | awk {'print "mc-tool request "$1" offline"'} | sh

I tried adding "sudo" before the commands and also "sudo gainroot" in the start of the scripts, but it didn't help - these lines are just being ignored.

is it possible to send output to a log file from dbus executions to see the errors?

i just tested a simple execution for someplayer which also doesn't work:
/usr/bin/someplayer

Did you have such issues?

EDITED: Solved this issue. i had to use "run-standalone.sh" for commands that didn't work.

Last edited by impeham; 2011-04-24 at 18:16.