Playing with BlueProximityblog which had a post on locking the screen automatically. Anyway after seeing the comments I found it will be interesting to use Bluetooth to achieve this. I wanted to write some script on my own to get it done. Anyway as an initial step I tried BlueProximity which comes with Ubuntu. Here is a list of steps to get everything working.
1. Install blueproximity:
$ sudo apt-get install blueproximity
2. Pair up your computer with your phone using Bluetooth. You can use System -> Preferences -> Bluetooth to do so.
3. start blueproximity:
$ blueproximity &
You will see the blueproximity icon appearing on your system panel.
4. Configure blueproximity to suit your likings, i.e. the distance after which your screen will get locked, time duration, etc.
Anyway it is not kicking unless I can write my own code :D