Difference between revisions of "Patch Change Carrier String"

From WebOS Internals
Jump to navigation Jump to search
Line 1: Line 1:
 
{{template:patch}}
 
{{template:patch}}
==Introduction==
+
[[Image:Change-carrier-string.jpg|right]]
This patch allows you to modify the carrier string so that instead of displaying "Sprint", it will show whatever you want it to. For instance, you could show your love for your phone and change the string to "PalmPre".  On the other hand, you could bypass the $1000 iPhone application, and simply state "I'm Rich".  Either way, it adds a touch of personality to your phone.
+
[[Image:Carrier-string2.jpg|right]]
  
Also included are instructions on how to change the color of the font of the carrier string and the date-and-time string in the middle of the top bar.
+
Further testing has revealed that editing bar-scene.html fails.  The following is a revised mod as a result of that testing.
  
==Editing Process==
+
Also, a point of interest - there is a lot more code in this, referencing SIM cards and other carrier type information. It's obvious that Palm is getting the WebOS ready for other carriers.
The following is step-by-step instructions on how to modify the carrier string and it's font color via accessing the Linux Commandline.  Some people call this "rooting  your pre", but it is actually not rooting, just modifying the linux code that the phone runs on.
 
  
To begin, you must be able to access Linux on your phone.  If you have no idea what this means, this will be a good starting point...[http://www.webos-internals.org/wiki/Portal:Accessing_Linux|Accessing Linux].
+
----
  
 +
Want to change the Sprint text in the upper left hand corner to something more interesting? Maybe your name or different carrier to fake out your friends? Well here’s how:
  
 +
You’ll need to: [[Portal:Accessing Linux | Access to Linux ]]
  
==Patching Process==
 
As of now, I have no idea how to create patches, but that is next on my agenda. 
 
  
Enjoy!
+
Log in and execute the following commands:
-jmartino2011, 16-Nov-09
+
<pre><nowiki>
 +
sudo -i
 +
</nowiki></pre>
 +
Unlock the file system:
 +
<pre><nowiki>
 +
mount -o remount,rw /
 +
</nowiki></pre>
 +
Change the directory:
 +
<pre><nowiki>
 +
cd /
 +
</nowiki></pre>
 +
Back up your old file in case you screw up or want to revert your changes:
 +
<pre><nowiki>
 +
cp /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js.bak
 +
</nowiki></pre>
 +
Edit the following:
 +
<pre><nowiki>
 +
vi /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js
 +
</nowiki></pre>
 +
 
 +
For version 1.3.1 - Go to line 484 (either scroll down or type :484 and hit enter) and make the following change. To edit a file through command line, press "i" on your keyboard and a "I" should show up on the bottom line of your program.  You can then make whatever edits you need to.  When you are done editing, hit "Esc" and then type ":wq" to save the file and get back to the command prompt.
 +
 
 +
(For version 1.0.4 - Go to line 440.  For version 1.1.0 - make the changes on lines 429, 444 & 467.  For version 1.2 and 1.2.1 - make the change on line 483.)
 +
 
 +
Of course, instead of using "Verizon" you can use what ever string you would like.
 +
<pre><nowiki>
 +
//$('carrier').innerHTML = this.carrierText
 +
$('carrier').innerHTML = $L("Verizon");
 +
</nowiki></pre>
 +
 
 +
 
 +
Turning on and off Airplane Mode brings back the "sprint".  To get it to show your string like "Verizon" again;
 +
 
 +
For version 1.3.1 - Go to line 835 (type :835) and make the following change. 
 +
 
 +
(For version 1.0.4 - Go to line 698.  For version 1.1.0 - Go to line 800.  For version 1.2 and 1.2.1 - Go to line 830.)
 +
 
 +
<pre><nowiki>
 +
//$('carrier').innerHTML = this.carrierText;
 +
$('carrier').innerHTML = $L("Verizon");
 +
</nowiki></pre>
 +
Lock your file system:
 +
<pre><nowiki>
 +
mount -o remount ro /
 +
</nowiki></pre>
 +
Restart LunaSysMgr:
 +
<pre><nowiki>
 +
/sbin/initctl stop LunaSysMgr
 +
/sbin/initctl start LunaSysMgr
 +
</nowiki></pre>
 +
 
 +
OR
 +
 
 +
<pre><nowiki>
 +
stop LunaSysMgr && start LunaSysMgr
 +
</nowiki></pre>
 +
 
 +
 
 +
== To Modify the Font Color ==
 +
 
 +
This modification works for at least 1.2, 1.2.1, and 1.3.1.  It has been verified for all three of those versions of webOS.
 +
 
 +
If you would like to modify the color of the carrier text, you must edit the appropriate .css file.
 +
 
 +
With the filesystem still unlocked in rw mode, back up the following file:
 +
 
 +
<pre><nowiki>
 +
cp /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css.bak
 +
</nowiki></pre>
 +
 
 +
Now edit the file with vi:
 +
<pre><nowiki>
 +
vi /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css
 +
</nowiki></pre>
 +
 
 +
Search to the line beginning with ''#carrier'' (line #93) and modify the color attribute from the default hex value of #fff to the desired [http://en.wikipedia.org/wiki/Web_colors HTML color] of your choice. The example below shows a red color.
 +
 
 +
<pre><nowiki>
 +
#carrier {
 +
                float: left;
 +
                color: #E01000;
 +
                margin-left: 2px;
 +
                white-space: nowrap;
 +
                overflow: hidden;
 +
                text-overflow: ellipsis;
 +
}
 +
</nowiki></pre>
 +
 
 +
If you would like to modify the color of the clock, make the following change to line #44 (approximate).  This will change the color of the clock to red-orange or something like that.  I used blue (0000FF) for the carrier string, so I have an orange and blue (I go to Univ. of FL) theme goin on.
 +
 
 +
<pre><nowiki>
 +
#date-and-time {
 +
                color: #FF8C00;
 +
                position: fixed;
 +
                margin: 1px 0 0 0;
 +
                top: 0;
 +
                left: 0;
 +
                height: 28px;
 +
                width: 100%;
 +
                padding: 0;
 +
                text-align: center;
 +
}
 +
</nowiki></pre>
 +
 
 +
 
 +
Then you can lock the filesystem and restart LunaSysMgr as above:
 +
<pre><nowiki>
 +
mount -o remount,ro /
 +
/sbin/initctl stop LunaSysMgr
 +
/sbin/initctl start LunaSysMgr
 +
</nowiki></pre>
 +
 
 +
== Modifying the Phone App ==
 +
The changes shown above modify the main view on the page. The changes listed below will modify the Phone App as well
 +
 
 +
Follow the instructions above on mounting the file system. Also, if you have not backed up your '''orignal''' bar-assistant.js file, be sure to do so. Do not back it up a second time, as this will overwrite your clean original.
 +
 
 +
Make the following changes on lines 214 & 239 (on WebOS 1.1):
 +
 
 +
<pre><nowiki>
 +
//$('appname').innerHTML = this.carrierText
 +
$('appname').innerHTML = $L("Verizon");
 +
</nowiki></pre>
 +
 
 +
Again, substituting "Verizon" with your string of choice.
 +
 
 +
Remount the file system as ro , and stop and restart LunaSysMgr
 +
 
 +
== Sources ==
 +
http://prebrew.org/blog/2009/07/01/customize-your-carrier-text/
 +
 
 +
http://forums.precentral.net/web-os-development/189942-change-your-carrier-text-anything-besides-sprint.html

Revision as of 03:43, 17 November 2009


Change-carrier-string.jpg
Carrier-string2.jpg

Further testing has revealed that editing bar-scene.html fails. The following is a revised mod as a result of that testing.

Also, a point of interest - there is a lot more code in this, referencing SIM cards and other carrier type information. It's obvious that Palm is getting the WebOS ready for other carriers.


Want to change the Sprint text in the upper left hand corner to something more interesting? Maybe your name or different carrier to fake out your friends? Well here’s how:

You’ll need to: Access to Linux


Log in and execute the following commands:

sudo -i

Unlock the file system:

mount -o remount,rw /

Change the directory:

cd /

Back up your old file in case you screw up or want to revert your changes:

cp /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js.bak

Edit the following:

vi /usr/lib/luna/system/luna-systemui/app/controllers/bar-assistant.js

For version 1.3.1 - Go to line 484 (either scroll down or type :484 and hit enter) and make the following change. To edit a file through command line, press "i" on your keyboard and a "I" should show up on the bottom line of your program. You can then make whatever edits you need to. When you are done editing, hit "Esc" and then type ":wq" to save the file and get back to the command prompt.

(For version 1.0.4 - Go to line 440. For version 1.1.0 - make the changes on lines 429, 444 & 467. For version 1.2 and 1.2.1 - make the change on line 483.)

Of course, instead of using "Verizon" you can use what ever string you would like.

//$('carrier').innerHTML = this.carrierText	
$('carrier').innerHTML = $L("Verizon");


Turning on and off Airplane Mode brings back the "sprint". To get it to show your string like "Verizon" again;

For version 1.3.1 - Go to line 835 (type :835) and make the following change.

(For version 1.0.4 - Go to line 698. For version 1.1.0 - Go to line 800. For version 1.2 and 1.2.1 - Go to line 830.)

//$('carrier').innerHTML = this.carrierText;
$('carrier').innerHTML = $L("Verizon");	

Lock your file system:

mount -o remount ro /

Restart LunaSysMgr:

/sbin/initctl stop LunaSysMgr
/sbin/initctl start LunaSysMgr

OR

stop LunaSysMgr && start LunaSysMgr


To Modify the Font Color

This modification works for at least 1.2, 1.2.1, and 1.3.1. It has been verified for all three of those versions of webOS.

If you would like to modify the color of the carrier text, you must edit the appropriate .css file.

With the filesystem still unlocked in rw mode, back up the following file:

cp /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css.bak

Now edit the file with vi:

vi /usr/lib/luna/system/luna-systemui/stylesheets/systemui.css

Search to the line beginning with #carrier (line #93) and modify the color attribute from the default hex value of #fff to the desired HTML color of your choice. The example below shows a red color.

#carrier {
                float: left;
                color: #E01000;
                margin-left: 2px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
}

If you would like to modify the color of the clock, make the following change to line #44 (approximate). This will change the color of the clock to red-orange or something like that. I used blue (0000FF) for the carrier string, so I have an orange and blue (I go to Univ. of FL) theme goin on.

#date-and-time {
                color: #FF8C00;
                position: fixed;
                margin: 1px 0 0 0;
                top: 0;
                left: 0;
                height: 28px;
                width: 100%;
                padding: 0;
                text-align: center;
}


Then you can lock the filesystem and restart LunaSysMgr as above:

mount -o remount,ro /
/sbin/initctl stop LunaSysMgr
/sbin/initctl start LunaSysMgr

Modifying the Phone App

The changes shown above modify the main view on the page. The changes listed below will modify the Phone App as well

Follow the instructions above on mounting the file system. Also, if you have not backed up your orignal bar-assistant.js file, be sure to do so. Do not back it up a second time, as this will overwrite your clean original.

Make the following changes on lines 214 & 239 (on WebOS 1.1):

//$('appname').innerHTML = this.carrierText	
$('appname').innerHTML = $L("Verizon");

Again, substituting "Verizon" with your string of choice.

Remount the file system as ro , and stop and restart LunaSysMgr

Sources

http://prebrew.org/blog/2009/07/01/customize-your-carrier-text/

http://forums.precentral.net/web-os-development/189942-change-your-carrier-text-anything-besides-sprint.html