X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=sites%2Fhome_page.git;a=blobdiff_plain;f=software%2Funix%2Fxtitle.sh;h=84d8ae06fea15672c6b097395f89dd8948ae6485;hp=f9b0c75d9de02fc91f2bb0132f7a77ca868be644;hb=80ef9a31a67d47857199502734a95700aae707ea;hpb=86ea87513c4c66ebfee8ef2a887730aaef65a82d diff --git a/software/unix/xtitle.sh b/software/unix/xtitle.sh index f9b0c75..84d8ae0 100755 --- a/software/unix/xtitle.sh +++ b/software/unix/xtitle.sh @@ -2,9 +2,9 @@ # 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 @@ -13,6 +13,7 @@ usage () { 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 () { @@ -44,7 +45,7 @@ check_tty () { 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 @@ -64,9 +65,14 @@ do 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