Update of /cvsroot/lastbash/lastbash
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13693
Modified Files:
lastbash
Log Message:
Using USR1 instead on HUP. HUP is used when xterm exits.
Index: lastbash
===================================================================
RCS file: /cvsroot/lastbash/lastbash/lastbash,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- lastbash 5 Dec 2006 16:46:38 -0000 1.78
+++ lastbash 5 Dec 2006 17:09:32 -0000 1.79
@@ -1615,7 +1615,7 @@
# Remove the lock
rm -f "${COMMAND_FILE_LOCK}"
# Signal the first instance
- kill -HUP "$(< $PID_FILE)"
+ kill -USR1 "$(< $PID_FILE)"
else
echo "Lockfile present, commands not sent"
fi
@@ -1647,9 +1647,9 @@
esac
}
-# Function: Receive the HUP signal {{{1
+# Function: Receive the USR1 signal {{{1
#-----------------------------------------------------------------------------
-function sighup()
+function sigusr1()
{
local CMD ARGS
@@ -1714,6 +1714,16 @@
fi
}
+
+# Function: Receive the TSTP signal {{{1
+#-----------------------------------------------------------------------------
+function sigtstp()
+{
+ tui_sbar "Cannot suspend"
+ sleep 1
+ tui_sbar
+}
+
# Function: The read key loop {{{1
#-----------------------------------------------------------------------------
function read_key_loop()
@@ -1830,22 +1840,25 @@
# Now, let's save the PID
echo -n $$ > "${PID_FILE}"
-# And trap the HUP signal
-trap sighup HUP
+# And trap the USR1 signal
+trap sigusr1 USR1
# Trap the WINCH signal, too
trap sigwinch WINCH
-# Trap INT, TERM and EXIT signals
-trap sigint INT TERM
-trap sigexit EXIT
-
# Initialize the terminal
term_init
# Start the Text User Interface
tui_start
+# Trap INT, TERM, HUP and EXIT signals
+trap sigint INT TERM HUP
+trap sigexit EXIT
+
+# Trap TSTP (suspend)
+trap sigtstp TSTP
+
# Next, connect to the Last.fm station
if tui_lastfm_connect
then
|