Skip to content

Instantly share code, notes, and snippets.

@guildencrantz
Created August 12, 2012 23:04
Show Gist options
  • Save guildencrantz/3335216 to your computer and use it in GitHub Desktop.
Save guildencrantz/3335216 to your computer and use it in GitHub Desktop.
Clean-up and launch selfspy from a spectrwm autorun command.
#!/bin/sh
PROJECT_DIR=$(dirname $(readlink -f $0))
pushd $PROJECT_DIR >/dev/null
echo `date` " Starting selfspy"
# Delete stale lock files.
if [[ -e selfspy.pid.lock ]]; then
rm -v selfspy.pid.lock
fi
# Delete old pid files
for i in `hostname`-*; do
rm -v $i
done
sleep 15 # Make sure X initializes
selfspy.py -c config -d $PROJECT_DIR
echo `date` " selfspy start completed"
popd >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment