maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N9 / N950 (https://talk.maemo.org/forumdisplay.php?f=51)
-   -   Toggle Standby (LPM) Screen + Toggle WLAN (https://talk.maemo.org/showthread.php?t=88466)

bibek 2013-01-20 17:53

Would it be a wrong place to ask for a Mobile Data toggle? Based on this : http://talk.maemo.org/showpost.php?p...&postcount=983

i messed around for some time, but couldn't get the desktop file working :/

thedead1440 2013-01-20 19:22

Re: Toggle Standby (LPM) Screen
 
bibek,

Your wish is my command :D

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...

N9uwu 2013-01-20 19:54

Re: Toggle Standby (LPM) Screen
 
Does anyone know where I should start looking, if I wanted to disable/enable the LPM screen bases on available notifications?
The "condition" I am looking for is the presence of a new call/sms/etc notification (which leads to a LPM notification symbol). I'd really appreciate any help or input as to where I can find/query this "condition".

Win7Mac 2013-01-20 20:15

Re: Toggle Standby (LPM) Screen
 
2 Attachment(s)
Usually, I switch powersave mode to achieve almost the same.
Here are some leaked protos of icons... :)
Ideas to add some beauty are very welcome.

Hacker 2013-01-20 20:47

Quote:

Originally Posted by Win7Mac (Post 1310593)
v1.1.1 is online. :) Thanks thedead1440!
Only difference to v1.1: the above icons are included.
The .deb can be gotten here.
Enjoy. :)

thedead1440 -- the link to the .deb for version 1.1.1 of the lpm toggle is 404'ing on me (same with the link in the first post). Could you please take a look and hook up a new link? Thanks.

Win7Mac 2013-01-20 20:58

Re: Toggle Standby (LPM) Screen
 
Quote:

Originally Posted by Hacker (Post 1316180)
the link to the .deb for version 1.1.1 of the lpm toggle is 404'ing on me.

Fixed now.

imaginaryenemy 2013-01-21 04:40

Quote:

Originally Posted by bibek (Post 1316133)
Would it be a wrong place to ask for a Mobile Data toggle? Based on this : http://talk.maemo.org/showpost.php?p...&postcount=983

i messed around for some time, but couldn't get the desktop file working :/

I can't get mcetools to install. I tried apt-get and the provided deb. I get an error in terminal with the apt-get and i get an invalid installation package error from the deb. Any help?

thedead1440 2013-01-21 04:45

Re: Toggle Standby (LPM) Screen
 
Quote:

Originally Posted by imaginaryenemy (Post 1316232)
I can't get mcetools to install. I tried apt-get and the provided deb. I get an error in terminal with the apt-get and i get an invalid installation package error from the deb. Any help?

You have to incept the package or use fixed origin if in open mode...

bibek 2013-01-21 11:16

Re: Toggle Standby (LPM) Screen
 
2 Attachment(s)
I got the data toggle working, but trying to make it interactive like the LPM isn't working.
Wanted to skip the notification, as it slows down ui during popup. And tried to change the icon name.
Getting errors in syntax and all types of mess.

thedead1440 can you package something like the lpm toggle?

Some Icons attached, in case you need.. from alternative icons thread http://talk.maemo.org/showthread.php?t=85769

Here's my code(not working)
#icon name is Data On
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
        sed -i 'On/Off/' /home/user/.local/share/applications/netToggle.desktop
        `/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


thedead1440 2013-01-21 12:03

Re: Toggle Standby (LPM) Screen
 
bibek,

Get toggle-wlan from here...

If you want the version without the dbus calls get v1.0-1 from here...

You can read the scripts here


All times are GMT. The time now is 20:01.

vBulletin® Version 3.8.8