View Single Post
Moderator | Posts: 6,215 | Thanked: 6,400 times | Joined on Nov 2011
#32
bibek,

Your wish is my command

Here you go:

Code:
#!/bin/sh

# Toggle WLAN radio state

STATUS=$(/sbin/mcetool --status | grep -v grep | grep WLAN | awk '{print $2}' | head -1)

if [ $STATUS == "enabled" ]
	then
	dbus-send --print-reply --dest=com.meego.core.MNotificationManager /notificationmanager com.meego.core.MNotificationManager.addNotification uint32:0 uint32:0 string:'device' string:'' string:"WLAN Off" string:'' string:'' uint32:0
	`/sbin/mcetool --disable-radio=wlan`
	else
	dbus-send --print-reply --dest=com.meego.core.MNotificationManager /notificationmanager com.meego.core.MNotificationManager.addNotification uint32:0 uint32:0 string:'device' string:'' string:"WLAN On" string:'' string:'' uint32:0
	`/sbin/mcetool --enable-radio=wlan`
fi
Save the above as /home/user/wlan.sh or anything to your heart's content...


Then for the .desktop file:

Code:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=Toggle WLAN
Exec=/bin/sh /home/user/wlan.sh
Icon=
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
save it as /home/user/.local/share/applications/toggle-wlan.desktop or anything you like and it is good to go

Icons not added; you can add them if you want to...
 

The Following 5 Users Say Thank You to thedead1440 For This Useful Post: