[lastbash-cvs] lastbash lastbash,1.113,1.114
Status: Beta
Brought to you by:
cstroie
|
From: Costin S. <cs...@us...> - 2007-01-24 13:17:59
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30200 Modified Files: lastbash Log Message: Added support for rxvt and screen terminal title. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- lastbash 24 Jan 2007 12:16:34 -0000 1.113 +++ lastbash 24 Jan 2007 13:17:55 -0000 1.114 @@ -131,9 +131,16 @@ # Function: Set the xterm title {{{1 #----------------------------------------------------------------------------- -function set_xterm() +function set_term_title() { - [[ "${TERM}" =~ "^xterm" ]] && echo -ne "\e]0;$1\a" + # Set the title for xterm and rxvt + if [ "${TERM:0:5}" == "xterm" ] || [ "${TERM:0:4}" == "rxvt" ] + then + echo -ne "\e]0;$1\a" + elif [ "${TERM:0:6}" == "screen" ] + then + echo -ne "\e^$1\e\\" + fi } # Function: Save the now_playing file {{{1 @@ -808,7 +815,7 @@ # Enter special mode tput smcup # Set a welcome xterm title - set_xterm "Welcome to ${PROG_TITLE}!" + set_term_title "Welcome to ${PROG_TITLE}!" # Define colors T_COLOR_BLACK="$(tput setaf 0)" @@ -853,7 +860,7 @@ function term_exit() { # Set a goodbye xterm title - set_xterm "Thank you for flying ${PROG_TITLE}!" + set_term_title "Thank you for flying ${PROG_TITLE}!" # Make sure to reset the scrolling area tput csr 0 ${T_LINES} # Move the cursor on upper-left corner and clear the entire screen @@ -1075,10 +1082,10 @@ # Set the xterm title and save the now_playing file if [ "${META_STREAMING}" == "true" ] then - set_xterm "${META_ARTIST} - ${META_TRACK}" + set_term_title "${META_ARTIST} - ${META_TRACK}" save_nowplaying "${META_ARTIST} - ${META_TRACK}" else - set_xterm "${PROG_TITLE}: Not streaming" + set_term_title "${PROG_TITLE}: Not streaming" save_nowplaying fi } |