WARNING: This guide is NOT for those who are uncomfortable using SSH to manipulate databases on their iPhones!

Will you mess something up? No… probably not, but you can’t come crying to us if you do!

Now, if you’re like me at all, you LOVE Google Calendar, and you use Google Mobile Sync… The sync is great, as it does contacts, gmail, and calendars… However it does not sync over your calendar colors. This is due to two things: There is no place in the Exchange ActiveSync protocol to include colors, and Apple has a terrible bug in their iPhone not allowing any custom/manual colors by default. Even if you use iCal to sync your calendars you’ll have noticed by now that the colors are NOT the same in iCal and on your iPhone.

If you have a lot of calendars, this can become mentally straining trying to memorize two different sets of colors. Not anymore! I’ve figured out how to manually chose those colors on your jailbroken iPhone!

First thing is first, you need to find out what colors you will need. You need RGB vales for this, NOT hexadecimal color codes. I just opened my Google Calendar, took a screenshot, and used a color dropper tool from any random photo manipulation tool to get my RGB values, and I jotted them down on a piece of scrap paper.

At this point you should also make sure SQLite3 is installed on your iPhone, just load up Cydia and search for it, if you’ve got a green check next to it, you’re all set, if not install it, and reboot if required.

Next up you’ll need to SSH into your iPhone. Use your favorite SSH tool to get in, and log in as root. Once you’re in you’ll want to issue these commands.

iPhone:~ root# cd /var/mobile/Library/Calendar/
iPhone:/var/mobile/Library/Calendar root# sqlite3 Calendar.sqlitedb
SQLite version 3.6.12
Enter “.help” for instructions
sqlite> select title,color_r,color_g,color_b from Calendar;
Default|-1|-1|-1
Personal|15|77|140
Work|181|0|13
School|229|98|0
Facebook|103|10|108
Tech Jawa|229|98|0
Tech Jawa Live|181|0|13
Holidays|47|141|0

Once you issue the above commands, you should see your calendar names and their current colors in RGB format. From here we’ll need to update the database to make changes. I made my changes to match my Google Calendar colors exactly, and here’s the commands that I entered, you should do the same, but replace the color values with your own, and obviously replace the titles with the titles of your calendars.

sqlite> update Calendar set color_r=102, color_g=140, color_b=217 where title=’Personal’;
sqlite> update Calendar set color_r=217, color_g=102, color_b=102 where title =’Work’;
sqlite> update Calendar set color_r=101, color_g=173, color_b=137 where title=’School’;
sqlite> update Calendar set color_r=51, color_g=102, color_b=204 where title=’Facebook’;
sqlite> update Calendar set color_r=242, color_g=166, color_b=64 where title=’Tech Jawa’;
sqlite> update Calendar set color_r=140, color_g=102, color_b=217 where title=’Tech Jawa TV’;
sqlite> update Calendar set color_r=221, color_g=85, color_b=17 where title=’Holidays’;
sqlite> select title,color_r,color_g,color_b from Calendar;
Default|-1|-1|-1
Personal|102|140|217
Work|217|102|102
School|101|173|137
Facebook|51|102|204
Tech Jawa|242|166|64
Tech Jawa TV|140|102|217
Holidays|221|85|17

That last command is just to verify your results, and you should be good to go, just open up the Calendar app (or re-open it, if you already had it open) and you should notice your changes. These changes also carry over to calendar based apps from Cydia such as “LockCalendar” and “LockInfo” as well.

Here’s my final results, compare them to the image at the top of the post of my Google Calendar colors.

Just in the case that you screw something up, here’s the original color values if you want them back.

181,0,13 – Red
229,98,0 – Orange
47,141,0 – Green
15,77,140 – Blue
103,10,108 Purple

Tagged with:  

40 Responses to “Guide: Change iPhone Calendar Colors Manually”

  1. Mel says:

    for some reason i can’t get the sqlite working in WinSCP terminal. it times out then aborts when i execute

    sqlite3 Calendar.sqlitedb

    i’ve been searching everywhere for hours now! haven’t had any luck.. pls help!!!

    [Reply]

    Corey DeGrandchamp Reply:

    @Mel,

    Try using PuTTy to SSH and issue the commands, perhaps its something with WinSCP.

    [Reply]

  2. Mel says:

    thank you soooo much! i can’t believe what took me a decade took only a few minutes with PuTTY! i really appreciate your very quick response..

    more power to techjawa! ^_^

    [Reply]

  3. Great article! Thx for the info!

    [Reply]

  4. Konstantin says:

    Does not work in IOS4… worked for a bit, but now works for a little but then reverts to originally wonky colours! Can anyone help?

    [Reply]

    Corey DeGrandchamp Reply:

    @Konstantin, it does work in iOS 4, been working on my iPhone 4 since the jailbreakme release, hasn’t failed me yet.

    [Reply]

  5. Dan Buhler says:

    Awesome! thanks so much.

    [Reply]

  6. Hugo says:

    Thank you for this post.
    I have one question: In my Library there isn’t a directory Calendar… How is this possible? Is it because I’m only syncing through the internet and not through iTunes?
    Using iOS4.1 on iPhone4

    [Reply]

    Anonymous Reply:

    @Hugo, I sync my calendar by google and this guide worked to me. (3GS, iOS4.1)

    [Reply]

    Anonymous Reply:

    @Hugo, I sync my calendar by google and this guide worked to me. (3GS, iOS4.1)

    [Reply]

  7. Hugo says:

    @Anonymous; Correct! I looked in the wrong place on the iPhone. cd /var/mobile/Library/Calendar/ needed to be cd /private/var/mobile/Library/Calendar/
    This post has worked great! I’m very happy with my new calendar colors.
    Thanks again for the post.

    [Reply]

  8. bpdunsta says:

    This worked great, but…..

    Afterward my google calendar (setup as exchange) stopped syncing, I could not manually add events on my iPhone, and when birthdays were added to existing contacts (on the device) they were not displaying on the “birthday” calendar (but pre-existing birthdays were).

    The only fix I came up with that worked was to delete the calendar database. So, I’m back to crappy colors, but at least my calendars work now. Oh well…

    [Reply]

    Corey DeGrandchamp Reply:

    @bpdunsta, Please see my below comment, I’m not experiencing issues that you’ve stated.

    [Reply]

  9. Auggie says:

    Same as bpdunsta :( The change works great, and colors are reflected as said. However, this breaks the calendar… you cannot create new events (you can create them, but they won’t show up at all), and new events that you create online from Google Calendar (or any other source) won’t sync to your device.

    Essentially, this changes your calendar colors then freezes the calendar from any kind of changes :(

    Any fix for this? Do we need to update permissions on the calendar DB once we’re done? Anything like that?

    [Reply]

    Corey DeGrandchamp Reply:

    @Auggie, I’m not seeing this behavior at all, iPhone 4, iOS 4.1

    I can create new events on the phone, and on Google Calendar, they sync just fine?

    [Reply]

    Corey DeGrandchamp Reply:

    @Auggie, I’m also sorry for you running into this post during the site re-design, I’m literally in the process of changing everything around, please bear with us.

    [Reply]

    Auggie Reply:

    @Corey DeGrandchamp,

    No problem :) Really helpful stuff here – and it is well laid out. I wonder what I’ve done differently… I came in via putty… maybe the issue is that I copied the original calendar db to a .bak (I always play it safe!), then used scp to get the file on my laptop and did the edits there…. and scp’d the file back to the iPhone…

    Think that would cause it? When trying to run the sqlite commands via putty I was getting errors that it could not be found…. (sqlite)…

    [Reply]

    Corey DeGrandchamp Reply:

    @Auggie, Try running the commands via PuTTY instead, that’s how I did it. Although don’t copy/paste, there’s a problem with the way this site formats the quote marks and how putty expects them, so type everything in manually. After you’re finished reboot the phone, (not just a repsring) and open the calendar app first, it should recognize all changes and continue to work.

    How are you syncing your calendars, via the Exchange ActiveSync protocol? That’s how I have mine set up and it’s been fine.

    Auggie Reply:

    @Corey DeGrandchamp,

    I’ll try that… and post back later on today. I’m @ work so can only work on this intermittently… I am syncing my Google calendars (and work calendar) via Exchange, yes.

    Look for my post later on with an update…

    Corey DeGrandchamp Reply:

    @Auggie, Will do, I get email notifications of all new comments so I can personally come back here and respond to them. So let me know how it goes and I’ll follow up.

    Make sure you keep your .bak file just incase though.

    I just did a few more tests and I can still create events on both the phone and gcal and it syncs both ways no problems.

    Just a tip too, if your’e making new CALENDARS (not events) you still have to go to http://m.google.com/sync/ on your Safari iPhone browser and select the new calendar to actually sync.

  10. Auggie says:

    Success :)

    Thanks for the great article.

    Readers – be sure to make your edits using sqlite via the command line (either from putty or using Mobile Terminal, I would think).

    I think my initial issue with events not updating occurred due to me pulling the Calendars db off of my devices via scp, and editing it then scp-ing the file back. Just do the edits using command line sqlite instead of any gui :)

    [Reply]

    Corey DeGrandchamp Reply:

    @Auggie, Thanks for pointing this out, glad to know that it worked out good.

    Others who are having issues, also must intall sqlite3 from Cydia (most users should already have this, as its required by a TON of package, but brand-new jailbreaks might not have this already)

    [Reply]

  11. Auggie says:

    Well, I know it’s been a while, but I’ve got a question. Does anyone else see some calendar colors changing for some reason? I’m not sure why it’s happening, but I’ve got three of my calendars that have now changed colors (out of seven total).

    I can change them back, sure, but I was hoping this would be a permanent solution. Anyone experience this, or have a theory as to why it’s happening to some of them?

    [Reply]

  12. Bartek says:

    Great thanks!!!
    Works perfectly in iOS4 4.1
    After the procedure just close and reopen calendar app (remove from background, sbsettings or however)

    THANK YOU

    [Reply]

  13. [...] Change iPhone Calendar Colors to Anything [...]

  14. Andy says:

    In case someone else runs into this: I kept getting a “sqlite3 command not found” error. Make sure you are on “developer” mode in Cydia (go to manage, then “settings” on the top-left). Then go to search and type “sqlite3″. Most likely you have “SQLite 3.x Library” installed, but you will also need “SQLite 3.x” (which is the actual sqlite3 app). Install it and voila, you are ready to go!

    It took me a while to figure this out, so sharing with others in case they run into the same problem.

    [Reply]

    Caleb Reply:

    @Andy,

    Thank you!!!!!!!

    [Reply]

  15. Rod says:

    I’m having troubles with this. I’ve used terminal and cyberduck. When I paste the follow command

    update Calendar set color_r=102, color_g=140, color_b=217 where title=’Calendar’;
 into the terminal application,

    It appears as this and seems to do nothing. What am I missing/doing wrong?

    update Calendar set color_r=217, color_g=102, color_b=102 where title,color_r,color_g,color_title,color_r,color_g,color_b;bImportanttitle =
    …>

    Thanks for your help.

    [Reply]

    Corey DeGrandchamp Reply:

    @Rod, don’t copy/paste, you’re ending up copying the wrong ‘ character via copy/paste, type it in manually and it should work.

    [Reply]

  16. Ward says:

    Works like a charm. Many thanks OP.

    [Reply]

  17. Oldie says:

    Just great. Thank you very much!

    [Reply]

  18. Xree says:

    Brilliant, flawless and useful. Thanks a bunch. Any thoughts on the colors in Appigo ToDo?

    [Reply]

    Corey Reply:

    @Xree, Sorry, not a clue about that app, IF (and that’s a big IF) it stores its color data in a .sqlite3 database (which is doubtful) then I dont see why you wouldn’t be able to.

    [Reply]

  19. JohnB says:

    By the way, if you install sshfs on your computer, then you can mount your iphone as a disk, and use the installation of sqllite3 on your computer (i.e. you won’t have to install sqllite3 on your iphone).

    [Reply]

  20. MFQ says:

    Could not get SSH to work trying this protocol on iPhone 4. However, used CyberDuck to download the Calendar.sqlitedb file, edited the calendar colors using SQLite Database Browser 2.0 b1, and reuploaded to the phone. Worked great!

    [Reply]

  21. Julio B says:

    Works like a charm!… I also copyed the Calendar.sqlitedb to my PC, made changes there and finally overwrited iphone file.

    Pd: 3GS, iOS 4.3.3

    [Reply]

  22. DaReCl says:

    This still works with iOS 5, although slightly different.

    Apple has changed the columns in the calendar database to not have three different columns for red (color_r), green (color_g) and blue (color_b) but instead only one column with a colour hex-code.

    sqlite> update Calendar set color=’#FF0000′ where title=’Calendar’;

    Greetings from Germany,
    David

    [Reply]

    Corey Reply:

    @DaReCl, This is awesome, it makes the process so much easier. I absolutely HATED converting the HEX to RGB every time.

    [Reply]

  23. Juve says:

    Thanks a lot!! :)
    This post is great.
    One issue though. My calendars title is in Hebrew. So instead of ‘title’, I used ‘rowid’.

    [Reply]

Leave a Reply

WordPress主题

Calendar

March 2010
M T W T F S S
« Feb   Apr »
1234567
891011121314
15161718192021
22232425262728
293031  

Sponsors

Free WordPress Themes