Reply
Thread Tools
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#1
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).
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2014-05-13 at 11:49.
 

The Following 3 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 2,290 | Thanked: 4,133 times | Joined on Apr 2010 @ UK
#2
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.
__________________

Wiki Admin
sixwheeledbeast's wiki
Testing Squad Subscriber
- mcallerx - tenminutecore - FlopSwap - Qnotted - zzztop - Bander - Fight2048 -


Before posting or starting a thread please try this.

Last edited by sixwheeledbeast; 2014-05-12 at 21:26. Reason: fix code box
 

The Following User Says Thank You to sixwheeledbeast For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#3
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 !?


--
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?
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2014-05-13 at 11:44.
 
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#4
Bump. Anybody? Some hint?
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#5
Really no one?
(except sixwheeledbeast with a good direction but not leading to solution)
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 
Reply


 
Forum Jump


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