maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   Shell script to control online/offline (https://talk.maemo.org/showthread.php?t=81937)

leke 2012-01-27 23:48

Shell script to control online/offline
 
Hi, I'd like to suggest an idea for an app to control the n810's online/offline functionality to respond when the user connects/disconnects the power input.

If nobody fancies a stab at it, could you point me in the right direction to something that would teach me to control events like that?

Thanks.

Addison 2012-01-28 00:03

Re: Shell script to control online/offline
 
Install gconf-editor.

That should at least get you started on this. :)

auouymous 2012-01-28 07:22

Re: Shell script to control online/offline
 
Quote:

Originally Posted by leke (Post 1156763)
Hi, I'd like to suggest an idea for an app to control the n810's online/offline functionality to respond when the user connects/disconnects the power input.

You want wifi to connect when you plug in the charger and disconnect when the charger is removed?

You need an app that listens for these two dbus signals:
dbus_bus_add_match(signal_bus, "type='signal',path='/com/nokia/bme/signal',interface='com.nokia.bme.signal',member='c harger_connected'", &dbus_error);
dbus_bus_add_match(signal_bus, "type='signal',path='/com/nokia/bme/signal',interface='com.nokia.bme.signal',member='c harger_disconnected'", &dbus_error);

The ICDUI show_conn_dlg(false) method will open the AP dialog, the ICD connect("[ANY]", 0) method will auto connect to the last AP and the ICD2 disconnect_req(0x8000) method disconnects from the AP.

http://maemo.org/api_refs/5.0/beta/i...dbus__api.html
http://maemo.org/api_refs/4.1/libconic-0.16/
http://maemo.org/maemo_release_docum....x/node10.html

The MCE req_device_mode_change("normal") method exits flight mode and the MCE req_device_mode_change("flight") method enters flight mode.

http://maemo.org/api_refs/5.0/5.0-fi...dev/files.html

tso 2012-01-28 13:40

Re: Shell script to control online/offline
 
There is a package called dbus-scripts-settings that can be used to configure commands that trigger on certain events.


All times are GMT. The time now is 14:02.

vBulletin® Version 3.8.8