View Single Post
MK99's Avatar
Posts: 644 | Thanked: 480 times | Joined on Jul 2012 @ Finland
#65
Thanks, it's beter flight-mode.
Code:
#!/bin/sh

STATUS=$(/sbin/mcetool --status | grep -v grep | grep Cellular | awk '{print $2}' | head -1)
if [ $STATUS == "enabled" ]
then
       sed -i 's/OFF/ON/' /home/user/.local/share/applications/toggle_flight.desktop
	dbus-send --print-reply --dest=com.meego.core.MNotificationManager /notificationmanager com.meego.core.MNotificationManager.addNotification uint32:0 uint32:0 string:'device' string:'' string:"Flightmode ON" string:'' string:"/home/user/.local/share/icons/hicolor/apps/flightON.png" uint32:0
	/sbin/mcetool --disable-radio=cellular
else
       sed -i 's/ON/OFF/' /home/user/.local/share/applications/toggle_flight.desktop
	dbus-send --print-reply --dest=com.meego.core.MNotificationManager /notificationmanager com.meego.core.MNotificationManager.addNotification uint32:0 uint32:0 string:'device' string:'' string:"Flightmode OFF" string:'' string:"/home/user/.local/share/icons/hicolor/apps/flightOFF.png" uint32:0
	/sbin/mcetool --enable-radio=cellular
fi
http://db.tt/nlRHm5v5

Last edited by MK99; 2013-01-23 at 20:41.