07/06/2009, 06:38 PM
|
#1 (permalink) |
|
Member
![]() Join Date: Jun 2009
Posts: 100
Likes Received: 1
Thanks: 10
Thanked 40 Times in 13 Posts
|
One of the features I liked on my old Treo was the blinking green LED when I had a waiting text message. There's no such functionality out of the box for the Pre.
With this change, however, the center button LED will illuminate when you have a waiting text message! As a prerequisite, you'll need the webosinternals services installed so you can run shell commands from within your application. If you already have this installed (for the my-tether application, for example) you can skip this step. As root: Code:
cd /tmp/ mount -o remount,rw / wget http://gitorious.org/webos-internals/applications/blobs/raw/db385edfa3f71ceb98401c16dd94b2490bfaaae5/org.webosinternals.services/org.webosinternals.services-0.4_all.ipk ipkg install org.webosinternals.services-0.4_all.ipk rm org.webosinternals.services-0.4_all.ipk Code:
cd /usr/palm/applications/com.palm.app.messaging/app/ mkdir scripts cd scripts Code:
#!/bin/sh sleep 9 echo 100 >/sys/class/leds/core_navi_center/brightness Code:
chmod 744 led_on.sh Code:
cd /usr/palm/applications/com.palm.app.messaging/app/controllers Code:
--- notification-assistant.js.bak Mon Jul 6 14:04:10 2009
+++ notification-assistant.js Mon Jul 6 18:48:17 2009
@@ -189,7 +189,15 @@
var dashboard = this.controller.getStageController(DashboardMessageStageName);
if (dashboard) {
+ var displayOn = this.Messaging.DisplayState.isDisplayOn();
dashboard.delegateToSceneAssistant("update");
+ if (!displayOn) {
+ this.controller.serviceRequest('palm://org.webosinternals.shell', {
+ method: 'runCmd',
+ parameters: {
+ cmd: '/usr/palm/applications/com.palm.app.messaging/app/scripts/led_on.sh'}
+ });
+ }
} else {
// Create a dashboard
var f = function(stageController){
@@ -214,9 +222,13 @@
this.isNewMessageDashboardPending = true;
createDashboard.delay(5);
}
-
} else {
createDashboard(); // if the screen is off, create the dashboard right away
+ this.controller.serviceRequest('palm://org.webosinternals.shell', {
+ method: 'runCmd',
+ parameters: {
+ cmd: '/usr/palm/applications/com.palm.app.messaging/app/scripts/led_on.sh'}
+ });
}
}
};
Code:
mount -o remount,ro / /sbin/reboot Last edited by Keegan99; 07/07/2009 at 10:57 AM. |
07/06/2009, 07:46 PM
|
#4 (permalink) |
|
Member
![]() Join Date: Jun 2009
Posts: 100
Likes Received: 1
Thanks: 10
Thanked 40 Times in 13 Posts
|
You can either decode it by hand and edit the source file manually (It's basically inserting two small blocks of code into the original notification-assistant.js) or you can grab and use the patch utility:
Code:
ipkg-opt install patch |
07/06/2009, 08:04 PM
|
#6 (permalink) |
|
Member
![]() Join Date: Apr 2007
Location: City of Angels
Posts: 2,533
Likes Received: 0
Thanks: 371
Thanked 175 Times in 132 Posts
|
This is great! Is there a way we can have it pulse twice for a new email, 3 times for a missed call, etc?
__________________
Palm History: Palm III>IIIc>CLIÉ NR70v>CLIÉ TG50>Tungsten C>Treo 650>Treo 700p>Centro>Pre!! 6/5/09 Phone History: Way too long ![]() Sorry Timmy, SERO does not work with the Pre. If you have an iTouch click me. |
07/06/2009, 08:51 PM
|
#7 (permalink) | |
|
Member
![]() Join Date: Dec 2008
Posts: 51
Likes Received: 0
Thanks: 5
Thanked 7 Times in 5 Posts
|
when installing the patch i get
Quote:
Last edited by lordelfkin; 07/06/2009 at 08:58 PM. |
|
07/06/2009, 08:52 PM
|
#8 (permalink) |
|
Member
![]() Join Date: Jun 2009
Posts: 100
Likes Received: 1
Thanks: 10
Thanked 40 Times in 13 Posts
|
Pulsing would be a bit of a challenge, as it would require a continuously running script changing the value of the LED intensity. Without the ability to more cleanly kick off and terminate background processes (or a robust LED API) I don't see a way to do it.
|
07/06/2009, 09:42 PM
|
#11 (permalink) |
|
Member
![]() Join Date: Jun 2009
Posts: 100
Likes Received: 1
Thanks: 10
Thanked 40 Times in 13 Posts
|
Ok, the copy and paste may have marred the patch file, so here's the attachment.
To run the patch, copy it to /usr/palm/applications/com.palm.app.messaging/app/controllers, then: Code:
cd /usr/palm/applications/com.palm.app.messaging/app/controllers patch -p0 -i notification-assistant.js.patch.txt |
07/06/2009, 09:54 PM
|
#13 (permalink) | |
|
Member
![]() Join Date: Jun 2009
Posts: 100
Likes Received: 1
Thanks: 10
Thanked 40 Times in 13 Posts
|
Quote:
|
|
07/06/2009, 09:59 PM
|
#14 (permalink) | |
|
Member
![]() Join Date: Apr 2007
Location: City of Angels
Posts: 2,533
Likes Received: 0
Thanks: 371
Thanked 175 Times in 132 Posts
|
Quote:
.Just an FYI: Code:
root@castle:/usr/palm/applications/com.palm.app.messaging/app/controllers# patch -p0 -i notification-assistant.js.patch.txt patching file notification-assistant.js Hunk #1 succeeded at 333 with fuzz 1 (offset 144 lines). Hunk #2 FAILED at 366. 1 out of 2 hunks FAILED -- saving rejects to file notification-assistant.js.rej
__________________
Palm History: Palm III>IIIc>CLIÉ NR70v>CLIÉ TG50>Tungsten C>Treo 650>Treo 700p>Centro>Pre!! 6/5/09 Phone History: Way too long ![]() Sorry Timmy, SERO does not work with the Pre. If you have an iTouch click me. |
|
07/06/2009, 10:13 PM
|
#17 (permalink) | |
|
Member
![]() Join Date: Jun 2009
Posts: 100
Likes Received: 1
Thanks: 10
Thanked 40 Times in 13 Posts
|
Quote:
|
|
07/06/2009, 10:15 PM
|
#18 (permalink) |
|
Member
![]() Join Date: Apr 2007
Location: City of Angels
Posts: 2,533
Likes Received: 0
Thanks: 371
Thanked 175 Times in 132 Posts
|
Nope, but just noticed it was wiped clean somehow and so was my backup, just copied a fresh js from the webos doctor and it worked.
__________________
Palm History: Palm III>IIIc>CLIÉ NR70v>CLIÉ TG50>Tungsten C>Treo 650>Treo 700p>Centro>Pre!! 6/5/09 Phone History: Way too long ![]() Sorry Timmy, SERO does not work with the Pre. If you have an iTouch click me. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|



