Find file
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (21 sloc) 756 Bytes
# $SHELL is unreliable. In particular, it doesn't get reset when I run bash
# inside zsh for testing. :)
# Sometimes we get '-zsh' or similar, so strip out that dash.
shell=`ps -p $$ | tail -1 | awk '{print $NF}' | sed 's/-//'`
# For development purposes only!
case $shell in
trap 'terminal-screensaver-reset' DEBUG
trap 'terminal-screensaver' SIGALRM
function preexec () { terminal-screensaver-reset; }
trap 'terminal-screensaver' SIGALRM
# Use the PID to differentiate between shells. We need to save it here because
# the scripts will run under their own PIDs.
export terminal_screensaver_pid=$$