-----> ls
away.sh here.sh proximity.sh standard.conf
-----> ls -l
total 16K
-rwxr-xr-x 1 sls sls 361 Jan 24 13:55 away.sh
-rwxr-xr-x 1 sls sls 625 Jan 24 14:21 here.sh
-rwxr-xr-x 1 sls sls 751 Jan 24 14:20 proximity.sh
-rw-r--r-- 1 sls sls 448 Jan 24 13:58 standard.conf
-----> cat standard.conf
device_mac = 00:25:E5:61:0F:8C
device_channel = 7
lock_distance = 7
lock_duration = 6
unlock_distance = 4
unlock_duration = 1
lock_command = /bin/bash ~/.blueproximity/away.sh
unlock_command = /bin/bash ~/.blueproximity/here.sh
proximity_command = /bin/bash ~/.blueproximity/proximity.sh
proximity_interval = 5
buffer_size = 1
log_to_syslog = False
log_syslog_facility = local6
log_to_file = True
log_filelog_filename = /home/sls/blueproximity.log
-----> cat away.sh
#!/bin/bash
# away.sh
# Executed when the bluetooth connection drops because the paired device is out of range
echo "Away from desk" >> ~/blueproximity.log
# Start the screensaver and lock the screen
gnome-screensaver-command --lock
# Tell motion to start recording, 0 is the first thread index
curl http://localhost:8080/0/detection/start >/dev/null 2>&1
-----> cat here.sh
#!/bin/bash
# here.sh
# Executed when blueproximity detects a bluetooth connection with the paired device
echo "Back at desk" >> ~/blueproximity.log
# Tell motion to stop recording, 0 is the first thread index
curl http://localhost:8080/0/detection/pause >/dev/null 2>&1
# Turn off the screensaver and unlock
gnome-screensaver-command -d
# Turning off the screensaver does not unblank the screen
# Simulate a mouse move to get xorg to reset the activity counter
# and do the right thing about power management
# This works but leaves the mouse in upper left corner of screen
xdotool mousemove 0 0
xdotool mousemove 5 5
-----> cat proximity.sh
#!/bin/bash
# proximity.sh
# This is a keep-alive command to make sure the screen does not lock while we are present
# Note that this runs even when the screen is locked
# The default configuration had the command "gnome-screensave-command -p" for poke.
# However, my version of this command (Mint) does not implement poke.
# So use the xdotool command instead
#echo "Proximity command invoked, do nothing" >> ~/blueproximity.log
# This works but is a little bad because it may move the mouse while you are working with it
# It is also bad because when the screen is locked and then goes blanked, doing the poke will
# unblank the screen. Probably not what is wanted. So for now, do nothing.
# There has to be a better way!
#xdotool mousemove 0 0
TopicTitle | Enable and disable recording in motion |
FeatureRequestStatus | New |
SubmittedBy | WikiGuest |