maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   [Announce/Question] Auto-changing IM rtcom accounts presence status (https://talk.maemo.org/showthread.php?t=93177)

peterleinchen 2014-05-12 18:48

[Announce/Question] Auto-changing IM rtcom accounts presence status
 
Inspired by those two threads
http://talk.maemo.org/showthread.php?t=43509
http://talk.maemo.org/showthread.php?t=55686

I made me a script which changes the status of all my accounts to any pre-defined profile (in rtcom-precence-ui.cfg) AND updating the status of my accounts AND the current status in hildon-status-menu (by plain killing/restarting).

As killing and letting them get retarted is not the best/reliablest way I would like to ask if someone has found a way to enable it via dbus call (see second link)?
Best would be a single call like the save button press in accounts menu!

At least I would like to ask for a reliable way of restarting hildon-status-menu, as killing needs to be done twice!??



Script is as follows:
Code:

#!/bin/sh

if [ x$1 == x ]; then exit 1; fi

grep ActiveProfile=$1$ /home/user/.osso/.rtcom-presence-ui.cfg
if [ ! $? == 0 ]; then
  sed -e s/ActiveProfile=[0-9]*/ActiveProfile=$1/ -i /home/user/.osso/.rtcom-presence-ui.cfg
  pkill telepathy-*
  killall -kill hildon-status-menu
  sleep 5
  killall hildon-status-menu
  exit 0
else
  exit 2
fi

and it is called from two scripts inside /etc/network/if-up
/etc/network/if-up.d/90_up_wifiscripts
/etc/network/if-up.d/91_up_gprsscripts
first one checks for my home WiFi and/or any other WLAN up
second if a GPRS/UMTS connection is up
and then calls the script with one parameter, which is the number of the desired profile defined in /home/user/.rtcom/.osso/.rtcom-presence-ui.cfg (where 0=online, 1=busy, 2=offline, 3..n=user profiles).

sixwheeledbeast 2014-05-12 21:26

Re: [Announce/Question] Auto-changing IM rtcom accounts presence status
 
The recommended way to "kill" these processes so they come back cleanly is dsmetool

Code:

#Kill h-s-m
dsmetool -k /usr/bin/hildon-status-menu
#Run foo with h-s-m killed
foo commands
#Restart h-s-m
dsmetool -t /usr/bin/hildon-status-menu

This goes for other hildon processes too.

peterleinchen 2014-05-12 21:53

Re: [Announce/Question] Auto-changing IM rtcom accounts presence status
 
Unfortunately the -k does not work for me.
(As dsmetool can only be run as run the start should be like dsmetool -t -U user "/usr/bin/hildon-status-menu", or?)

Also a normal killall xxx is not enough. It has to be a killall -sigkill xxx !? :confused:


--
After fiddling around a bit. dsmetool may work, but there two processes of /usr/bin/hildon-status-menu. One started from dsme-server and one from maemo-launcher.
I have no idea why there two occurences and why dsmetool -k nor killall does not bring down the status menu.

Furthermore after the first kill the restarted status-menu does not contain all items, so a second killall (but without -sigkill) is needed.

Anyone?

peterleinchen 2014-05-16 20:33

Re: [Announce/Question] Auto-changing IM rtcom accounts presence status
 
Bump. Anybody? Some hint?

peterleinchen 2014-05-18 18:59

Re: [Announce/Question] Auto-changing IM rtcom accounts presence status
 
Really no one?
(except sixwheeledbeast with a good direction but not leading to solution)


All times are GMT. The time now is 11:40.

vBulletin® Version 3.8.8