The Following 31 Users Say Thank You to thedead1440 For This Useful Post: | ||
ajalkane, AMD, banong, ceteigrek, ck2nb, gsalone, guillermorojaz, Hacker, HELLASISGREECE, imaginaryenemy, Jordi, khan.orak, kumary, Lucazz990, Mikkosssss, MK99, mousse04, mrsellout, nbedford, peterleinchen, ranbaxy, ruplee76, Schturman, shanttu, slarti, smoothc, Sourav.dubey, thp, tommo, trayhoper, Win7Mac |
|
2012-12-31
, 17:42
|
Moderator |
Posts: 6,215 |
Thanked: 6,400 times |
Joined on Nov 2011
|
#2
|
~# cat /home/user/.local/share/data/toggle-lpm/toggle-lpm.sh #!/bin/sh # Toggle Low Power Mode (Standby Screen) by thedead1440 STATUS=$(gconftool --get /system/osso/dsm/display/use_low_power_mode) if [ $STATUS == "true" ] then gconftool -s --type=bool /system/osso/dsm/display/use_low_power_mode false sed -i 's/toggle\-lpm\-on/toggle\-lpm\-off/' /home/user/.local/share/applications/toggle-lpm.desktop dbus-send --print-reply --dest=com.meego.core.MNotificationManager /notificationmanager com.meego.core.MNotificationManager.addNotification uint32:0 uint32:0 string:'device' string:'' string:"Standy Screen Off" string:'' string:"/home/user/.local/share/icons/hicolor/apps/toggle-lpm-off.png" uint32:0 else gconftool -s --type=bool /system/osso/dsm/display/use_low_power_mode true sed -i 's/toggle\-lpm\-off/toggle\-lpm\-on/' /home/user/.local/share/applications/toggle-lpm.desktop dbus-send --print-reply --dest=com.meego.core.MNotificationManager /notificationmanager com.meego.core.MNotificationManager.addNotification uint32:0 uint32:0 string:'device' string:'' string:"Standy Screen On" string:'' string:"/home/user/.local/share/icons/hicolor/apps/toggle-lpm-on.png" uint32:0 fi
~# cat /home/user/.local/share/applications/toggle-lpm.desktop [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Terminal=false Name=Toggle LPM Exec=/bin/sh /home/user/.local/share/data/toggle-lpm/toggle-lpm.sh Icon=/home/user/.local/share/icons/hicolor/apps/toggle-lpm-on.png X-Window-Icon= X-HildonDesk-ShowInToolbar=true X-Osso-Type=application/x-executable
#!/bin/sh # Toggle WLAN by thedead1440 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:"/home/user/.local/share/icons/hicolor/apps/toggle-wlan-off.png" uint32:0 sed -i 's/toggle\-wlan\-on/toggle\-wlan\-off/' /home/user/.local/share/applications/toggle-wlan.desktop gconftool -s --type=bool /system/osso/connectivity/network_type/restricted_mode true `/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:"/home/user/.local/share/icons/hicolor/apps/toggle-wlan-on.png" uint32:0 sed -i 's/toggle\-wlan\-off/toggle\-wlan\-on/' /home/user/.local/share/applications/toggle-wlan.desktop gconftool -s --type=bool /system/osso/connectivity/network_type/restricted_mode false `/sbin/mcetool --enable-radio=wlan` fi
#!/bin/sh # Toggle WLAN by thedead1440 STATUS=$(/sbin/mcetool --status | grep -v grep | grep WLAN | awk '{print $2}' | head -1) if [ $STATUS == "enabled" ] then sed -i 's/toggle\-wlan\-on/toggle\-wlan\-off/' /home/user/.local/share/applications/toggle-wlan.desktop gconftool -s --type=bool /system/osso/connectivity/network_type/restricted_mode true `/sbin/mcetool --disable-radio=wlan` else sed -i 's/toggle\-wlan\-off/toggle\-wlan\-on/' /home/user/.local/share/applications/toggle-wlan.desktop gconftool -s --type=bool /system/osso/connectivity/network_type/restricted_mode false `/sbin/mcetool --enable-radio=wlan` fi
[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Terminal=false Name=Toggle WLAN Exec=/bin/sh /home/user/.local/share/data/toggle-wlan/toggle-wlan.sh Icon=/home/user/.local/share/icons/hicolor/apps/toggle-wlan-on.png X-Window-Icon= X-HildonDesk-ShowInToolbar=true X-Osso-Type=application/x-executable Name[en_SG]=toggle-wlan.desktop
|
2012-12-31
, 18:11
|
|
Posts: 1,390 |
Thanked: 710 times |
Joined on May 2012
@ Beirut, Lebanon
|
#3
|
I will vote AMD for president next time if I'm having any shares during next meeting.
The Following 2 Users Say Thank You to AMD For This Useful Post: | ||
|
2012-12-31
, 18:24
|
Posts: 228 |
Thanked: 137 times |
Joined on Jan 2012
@ UK
|
#4
|
The Following User Says Thank You to nbedford For This Useful Post: | ||
|
2012-12-31
, 18:26
|
|
Posts: 644 |
Thanked: 480 times |
Joined on Jul 2012
@ Finland
|
#5
|
The Following User Says Thank You to MK99 For This Useful Post: | ||
|
2012-12-31
, 18:29
|
Moderator |
Posts: 6,215 |
Thanked: 6,400 times |
Joined on Nov 2011
|
#6
|
|
2012-12-31
, 20:13
|
|
Posts: 645 |
Thanked: 519 times |
Joined on Apr 2012
@ Finland
|
#7
|
|
2012-12-31
, 20:26
|
Posts: 228 |
Thanked: 137 times |
Joined on Jan 2012
@ UK
|
#8
|
nbedford,
Even if it isn't mirroring the gconf key correctly, the script gets the present gconf then makes the change so maybe toggling more than once fixes it... Do report if it does help as I didn't expect anyone other than Win7Mac to have any use for this
|
2012-12-31
, 20:45
|
|
Posts: 644 |
Thanked: 480 times |
Joined on Jul 2012
@ Finland
|
#9
|
|
2013-01-01
, 00:48
|
Moderator |
Posts: 6,215 |
Thanked: 6,400 times |
Joined on Nov 2011
|
#10
|
I don't think this is required by most people (I don't need it too) but since I've done it might as well post it here.
Basically its just 2 icons, 1 sh file and 1 .desktop file.
.DEB for Toggle-LPM:
v1.1.1
.DEBs for Toggle-WLAN:
v1.0.1
v1.0.1-1
All files are here for toggle-lpm and here for toggle-wlan so feel free to modify if requried.
Changelog:
Toggle Wlan v1.0.1 and v1.0.1-1 - 22/02/13:
Added Toggle WLAN v1.0 and v1.0-1 - 21/02/13:
v1.1.1 - 04/01/13:
v1.1 - 03/01/13:
v1.0 - 01/01/13:
Screenshots:
Last edited by thedead1440; 2013-01-22 at 17:33. Reason: added info on toggle-wlan