![]() |
Re: wiki page about dbus-scripts a great toy to play with dbus
|
Re: wiki page about dbus-scripts a great toy to play with dbus
Quote:
|
Re: wiki page about dbus-scripts a great toy to play with dbus
Quote:
Code:
dbus-scripts --debug --systemThe next step would be to then write a dbus triggered script for the dimming. This is all possible, the parts are available, you just have to assemble them! So, run the above command... |
Re: wiki page about dbus-scripts a great toy to play with dbus
Quote:
/usr/bin/logit.sh Code:
#!/bin/shInsert in config (/etc/dbus-scripts.d/dbus-scripts-example): Code:
* /usr/bin/logit.shOff Topic: Quote:
http://www.youtube.com/watch?v=pL2T8A3OfmA |
Re: wiki page about dbus-scripts a great toy to play with dbus
Thanks for the help :)
A few questions: Issue 1: After activating debug mode, i get the same event for both the TV connector and a headphone when they are connected to the audio jack: org.freedesktop.Hal.Device Condition ButtonPressed jack_insert There is a widget called "TV Out control desktop widget" which has a flag "TV out" which gets a value of on/off when device is connected to TV. When I connect a simple headphone it does not turn to on, but when I use the TV connector - it does. Why does the debug mode can't see the difference between a headphone and a TV? Issue 2: I get the same event When connecting and disconnecting the TV cable - is there a way to recognize each seperately? Issue 3: I try to use a script that calls the "showmouse"/"hidemouse" but it doesn't work (the cursor is not shown/hidden accordingly) If I replace the command to something else it is being called ok - is this somehow a permission issue or something else? Thanks. |
Re: wiki page about dbus-scripts a great toy to play with dbus
Quote:
1. Because the dbus message is simply to notify the system that a device has been connected to the jack socket, the system then determines what it is after that. 2. Yea, see below. 3. I don't understand what you mean here..What is this show/hide mouse thing? Bingo! So, we have a 'trigger' (the insertion of the jack) and a method to determine if it is the video cable or not. All the peices are present, all you have to do now is join the dots... From terminal the command: Code:
lshal | grep "video-out"Code:
#!/bin/shNext steps finish script, hook it into dbus-scripts. That will have to wait till I am not at work though! XD |
Re: wiki page about dbus-scripts a great toy to play with dbus
Quote:
#!/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. |
Re: wiki page about dbus-scripts a great toy to play with dbus
is it possible to use a dbus command to do these:
1. change the active desktop (to a specific one of the 4 i have) 2. send a keyboard press |
Re: wiki page about dbus-scripts a great toy to play with dbus
Quote:
It does approximately that. |
Re: wiki page about dbus-scripts a great toy to play with dbus
Code:
gconftool-2 -s /apps/osso/hildon-desktop/views/current -t int 1 |
| All times are GMT. The time now is 12:39. |
vBulletin® Version 3.8.8