Posts Tagged ‘Mac’

Convert your new iPod nano into a watch

Wednesday, November 24th, 2010

When Apple launched the latest iPod nano, people all over the blogosphere said, ‘almost an iWatch’. The design firm Mnml has come up with an awesome concept. It’s almost ready for production and I believe its going to be a huge success. Like their other designs this concept kit seems like a thing of beauty to match Apple’s own new design of the nano.

iPhone surgery

Tuesday, July 13th, 2010

Just finished a scary but successful procedure on my iPhone 3G, Alhamdulillah. When iOS4 was launched, I upgraded, jailbroke and unlocked it. In hindsight this wasn’t a good decision. My phone got slow and sluggish. I knew I had to go back to the previous version of the software as the iPhone 3G specs are just not worthy of iOS4. What I needed to do was:
1. downgrade from jailbroken iOS4 to iPhone OS 3.1.3
2. jailbreak iPhone OS 3.1.3
3. unlock my iPhone

A quick glance on the internet returned nothing. So I took a stab at it and the effort was fruitful in the end. Leave a comment if you want to know the details.

Growl notifier for mac’s battery status

Tuesday, February 9th, 2010

There have been many times that my macbook’s battery is almost running out and about to die and I don’t pay attention to the icon in my menubar. The warning itself appears only when the battery level is 10% remaining. Recently however, this problem started causing more pain. My battery needs to be replaced, because of which at about 23% the machine will just shutdown. So I wrote a small script that calculates the battery power and along with some launchctl magic and growl, I now get a notification when my batter level is below 30%.

Here is what you need to do. Download growl 1.2 from here and install it. If you are using Adium you will most likely already have growl. To test, run this command in your terminal after you install growl.

growlnotify -m "test message"

The code for getting the battery capacity notification is below

#! /bin/bash
NOTIFICATION_THRESHOLD="30"
#this works only on snow leopard 10.6.
charge=`/usr/sbin/ioreg -l | /usr/bin/grep -i capacity | /usr/bin/tr '\n' ' | ' | /usr/bin/awk '{printf("%.0f",$10/$5 * 100)}'`
if [ $charge -lt $NOTIFICATION_THRESHOLD ]; then
message="Battery power level is $charge%"
/usr/local/bin/growlnotify -t "BatteryNotifier" -s -m "$message"
fi

The full paths are essential for the next step. Save the above in a file, make it executable with ‘chmod +x’ and run. You will not see anything if your battery charge is above 30%. In order to run this as a cronjob or daemon process create a file of type launchd.plist in
~/Library/LaunchAgents/
and give the file a unique name. My file is named com.abuhafsa.BatteryNotifier.plist.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>com.abuhafsa.BatteryNotifier</string>
        <key>ProgramArguments</key>
        <array>
                <string>/opt/scripts/daemons/battery_notifier.sh</string>
        </array>
        <key>StartInterval</key>
        <integer>300</integer>
</dict>
</plist>

Remember to change the location of the script to where your file is stored. The ‘StartInterval’ is time in seconds. Change it to whatever you desire and the script will run at that interval. Now logout and log back, which will enable launchctl to add this daemon to its list of tasks.

Gmail tasks as a dashboard widget

Friday, March 20th, 2009

Ever since Gmail came out with their tasks feature I’ve loved it. For my limited use, its simple, easy and usable. If you are using OS X, here is a quick way to create a dashboard widget. All you need is Safari, both versions 3 and 4 will work in the manner detailed below.

  1. Launch Safari and open preferences.
  2. Select the ‘Advanced’ tab, check the ‘Show Develop menu in menu bar’ option and then close the window.
  3. Open a new tab in safari and select the ‘Develop’ menu. Navigate to ‘User agent’ > Mobile Safari 2.2.1 – iPhone
  4. Back to your tab, now go to http://gmail.com/tasks. Log in with your gmail account and you should see the layout just as you would on the iphone.
  5. If you have the tool button for dashboard (it’s the one with the scissors) on safari enabled use that or go to File > Open in Dashboard
  6. Select the area your want to see in the widget and click ‘Add’ on the top right. The dashboard should open with the widget now. That’s it!

This widget is fully functional. You can add lists, create tasks etc. Everything you can do on the iphone you can do here. If however you want the desktop version of this then replace the url with “http://mail.google.com/tasks/ig”. Here you have to resize the window first and then repeat step 5 and 6.

UPDATE: Google Apps customers should use the url ‘http://mail.google.com/tasks/a/<your-doman-name>/iphone’.

Gmail notifier for multiple accounts

Friday, January 2nd, 2009

These days who doesn’t have multiple gmail accounts. The popularity of gmail has skyrocketed in the last couple of years. As for me, I not only have multiple gmail accounts but also use the Google apps to manage multiple domains. Managing all these account efficiently can really be a challenge. Add to that if you have multiple machines, you are talking about possible serious lack of synchronization. I’ll share a couple of ways I have tried overcome this challenge.

1. Use a mail application

One way to solve this issue is to have IMAP enabled on your gmail accounts and then use a mail app like Mail.app that comes with your mac. Another good app is Thunderbird, from Mozilla. I’ve used both but my personal favourite is Mail.app. To enable IMAP on your gmail account

  1. Navigate to ‘Settings’ on gmail’s inbox page.
  2. Look for the ‘Forwarding and POP/IMAP’ tab setting-imap
  3. Scroll to the ‘IMAP Access’ section on that tab, select the ‘Enable IMAP’ radio button, save changes and you are done.enable imap
  4. To configure you mail application follow the instructions from gmail.

Note: The above will also work on windows.

2. Use a mail notifier

I have Mail.app configured with all my gmail and other POP/IMAP accounts setup on my home mac. But at work I didn’t want to do that. I just needed some way to get notified of a new mail and I was happy to check it in gmail’s web interface. I tried using an extention for firefox, but it wasn’t practical. For one thing, I to manually click on the icon in the status bar and switch between various accounts to see if there was a new mail. Nope, that is just not how I wanted it. That led me re-visit an application I had used in the past, Google Notifier. This application provided by Google and is available for Mac and windows. But the trick was to make it work with multiple account. A little search for that on google itself, turned up a few answers. Below I’ve detailed what I’ve done.

  1. Download the mac version of the notifier.
  2. After installing it, do a ‘secondary click’ (i’ve configured my mac to do this by tapping with two fingers) on the application icon and then click ‘Duplicate’. duplication
  3. Repeat step 2 for as many accounts you want. Then rename all of them for each account, so that it’s easy to remember.
  4. Do a secondary click again , but this time chose ‘Show Package contents’.
  5. Navigate to ‘Contents’, and open Info.plist in your favorite text editor.
  6. Search for the key CFBundleIdentifier and change the value from the default, com.google.GmailNotifier, append your own identifier to the value. I’ve just called it com.google.GmailNotifier2.
  7. For each of the duplicates you created in 3, repeate 4-6.
  8. Thats it. Lauch each application now and enter your login credentials.

After doing this you will find that the notifiers icons in the menu bar. If you have emails in your accounts, you will see that all the icons look the same, the default red envelope. It can be hard to say in an instant which account has a new mail. This can easily be changed. Have a look at my menu bar.

picture-6I have simply changed the icons used by each account. You can use any image. Just name in unread.png (it should be in a PNG format). Be sure to make the image 24×24 pixel in resolution. Now drop this image file in your Google Notifier > Contents > Resources folder. Relaunch the application and enjoy !

UPDATE: I’m adding the icons you can use like I did. Click this link to download a zip file – Icons for gmail notifier