# customization parameters
#ttyprefix=/dev/tty ;# what to add to ttycolumn's word to obtain valid device
ttyprefix=/dev/; #for linux systems with /dev/pts
-cmdcolumn=4 ;# where to find command in ps output
+cmdcolumn=5 ;# where to find command in ps output
ttycolumn=2 ;# where to find tty name in ps output
-psargs=-aww;
+psargs=aww;
# displays usage information
usage () {
echo "xtitle [ -t tty|-c command] [-i|-w|-f] title" >&2
echo " -i notifies, that only icon name should be changed" >&2
echo " -w that window name only (default - both)">&2
echo " -f changes font instead of title" >&2
+ echo " -r raises/deiconifies window instead of changing title" >&2
}
# tries to get tty name from command name
get_tty_from_command () {
tty=`tty`
# by default change both window name and icon name
mode=0
-set -- `getopt "iwfc:t:h" $*`
+set -- `getopt "iwrfc:t:h" $*`
if [ $? != 0 ]
then
usage
usage
exit 0
;;
+ -r) raise_mode=1; shift;;
--) shift; break;;
esac
done
+echo "tty=$tty"
+if [ -n "$raise_mode" ]; then
+ echo -ne "\\033[1t\\033[5t" >$tty
+fi
echo -e "\\033]$mode;$*\a\c" >$tty