KMobileLock

From ThorstensHome
Jump to: navigation, search

A tool that switches on your screensaver as soon as your mobile phone is away from your computer and switches off your screensaver as soon as the phone is near to the computer. With other words: Never type your password again - you go away and your screen is locked. You come back and your screen unlocks. This is because you carry your mobile phone with you and your computer detects via bluetooth how near it is.

This is for KDE only.

#!/bin/bash

hcitool cc 00:16:4E:62:BE:31

while true
do
  sleep 1
  if (( $(hcitool lq 00:16:4E:62:BE:31|awk '{print $3;}') < 250 )); 
  then dcop kdesktop KScreensaverIface lock; 
  else 
    dcop kdesktop KScreensaverIface quit
    hcitool cc 00:16:4E:62:BE:31
  fi
done

See also