Advertisement
shiftdot515

churchlife.ksh

Feb 6th, 2025
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 16.95 KB | None | 0 0
  1. #!/sbin/mksh
  2. sequence(){
  3. print
  4. print churchlife
  5. print norighttolife
  6. print churchlife NO righttolife
  7. }
  8.  
  9. flash()
  10. {
  11.  REVVID
  12.  emit " DO NOT DISMANTLE ANY SHIPS OF EDUCATION" 2.5
  13.  NORMVID
  14.  print
  15. }
  16. Reasoning()
  17. {
  18.  PRINTDOUBLEHEIGHT "Reasoning any to abolish"
  19.  PRINTDOUBLEHEIGHT "is divine right of kings"
  20.  RED; print " x     x      x      x" ; NORMAL
  21.  MOVEWINDOW  ${xterm_info[0]}  ${xterm_info[1]}
  22.  
  23.  INVERSE;emit "Armistice" ; INVERSENOT; emit " " 1.5 ;DOUBLEWIDTHLINE
  24.   BOLD ; emit " 1" 1.5; NORMAL; SINGLEWIDTHLINE ; emit " " 1.5
  25.  
  26.  #article 1 says insert god if everfound here,into the federal code
  27.  # God could also be useful to miltary  if abroad or on high seas.
  28.  # alright should I lol() that.
  29. }
  30.  
  31. sequence2(){
  32. print
  33. emit "Church life " ; emitline NO right to life
  34. emit "Church life " ; emitline NO right to life
  35. emitline Church life  NO right to life
  36. }
  37.  
  38. run() {
  39.  sequence
  40.  Reasoning
  41.  sequence
  42.  CURSOR save
  43.  for N in 1 2 3
  44.  do
  45.  CURSOR up 2
  46.  sequence2
  47.  done
  48.  CURSOR restore
  49. }
  50. #INSERTLINE  8; print "it was like 3 paragraphs"
  51. #UP 9
  52. #INSERTCHAR 10
  53. #### XTERM related ########
  54. icontitile(){  echo -e "\e]1;$*\a\c" ; }   # change icon name
  55. windowtitle(){ echo -e "\e]2;$*\a\c" ; }   # change window title
  56.  
  57. xproperty(){   echo -e "\e]3;$*\a\c" ; } # set X prop=value #prop to delete
  58. xcolor(){      echo -e "\e]4;$1;$2\a\c" ; }  
  59. xxcolor(){     echo -e "\e]5;$1;$2\a\c" ; }
  60.  
  61.  
  62. G0(){ echo -e "\017\c" ; }  # SI CTRL-O switch to standard character set
  63. G1(){ echo -e "\016\c" ; }  # SO CTRL-N switch to alternate character set
  64. G2SS(){ echo -e "\eN\c" ; } # SS2 Single Shift Select of G2 character set
  65. G3SS(){ echo -e "\eO\c" ; } # SS3 Single Shift Select of G3 character set
  66.  
  67. #echo 531
  68. CR(){ echo -e "\015\c" ; }   # carriage return
  69. LF(){ echo -e "\012\c" ; }   # line need or new line
  70. TABSET(){
  71. #TABSET col 10 20 30 ...
  72. #TABSET clear_all
  73. #TABSET cleartab 20 25 30 ...
  74. case "${1}" in
  75.   col)
  76.       shift
  77.       for COL in $@
  78.       do
  79.         CURSOR column $COL
  80.         echo -e '\eH\c' # Horizontal Tab Set ## HTS
  81.       done;;
  82.   clear_all)
  83.      echo -e '\e[3g\c' ;;  # TBC clear all tabs (works)
  84.   clear_tab)
  85.       shift
  86.       for COL in $@
  87.       do
  88.         CURSOR column $COL
  89.         echo -e '\e[0g\c'  # TBC clear tab at current column
  90.       done ;;
  91.   *)      echo -e '\eH\c' ;; # Horizontal Tab Set ## HTS
  92. esac
  93. }
  94. SS2(){ echo -e '\eN\c' ; }   # Single Shift for one G2 character
  95. SS3(){ echo -e '\eO\c' ; }   # Single Shift for one G3 character
  96. DOUBLEHEIGHTLINETOP(){ echo -e "\e#3\c" ; }  #DECDHL  top half
  97. DOUBLEHEIGHTLINEBOT(){ echo -e "\e#4\c" ; }  #DECDHL  bottom half
  98. PRINTDOUBLEHEIGHT(){
  99. echo -n "$1"
  100. echo -e "\e#3"
  101. echo -n "${2:-$1}"   # bottom, default 2same, but allow experimentation
  102. echo -e "\e#4"
  103. SINGLEWIDTHLINE; # cleanup
  104. }
  105. SINGLEWIDTHLINE(){ echo -en "\e#5" ; }      #DECSWL
  106. DOUBLEWIDTHLINE(){ echo -en "\e#6" ; }      #DECDWL
  107. SCREENTEST(){      echo -en "\e#8" ; }  #DECALN screen alignmnet test
  108. NORMAL(){ echo -e '\e[0m\c' ; }   # character attributes
  109. BOLD(){ echo -e '\e[1m\c' ; }  
  110. UNDERLINE(){ echo -e '\e[4m\c' ; }
  111. BLINK(){ echo -e '\e[5m\c' ; }
  112. INVERSE(){ echo -e '\e[7m\c' ; }
  113. INVISIBLE(){ echo -e '\e[8m\c' ; }
  114. UNDERLINENOT(){ echo -e '\e[24m\c' ; }
  115. BLINKNOT(){ echo -e '\e[25m\c' ; }
  116. INVERSENOT(){ echo -e '\e[27m\c' ; }
  117. INVISIBLENOT(){ echo -e '\e[28m\c' ; }
  118. BLACK(){   echo -e '\e[30m\c' ; }
  119. RED(){     echo -e '\e[31m\c' ; }
  120. GREEN(){   echo -e '\e[32m\c' ; }
  121. YELLOW(){  echo -e '\e[33m\c' ; }
  122. BLUE(){    echo -e '\e[34m\c' ; }
  123. MAGENTA(){ echo -e '\e[35m\c' ; }
  124. CYAN(){    echo -e '\e[36m\c' ; }
  125. WHITE(){   echo -e '\e[37m\c' ; }
  126. COLORFG(){   echo -e "\e[38;5;${1:-0}m\c" ; } # 88/256 color support
  127. COLORBG(){   echo -e "\e[48;5;${1:-0}m\c" ; } # 88/256 color support
  128. ORIGINAL(){ echo -e '\e[39m\c' ; }
  129. BGBLACK(){  echo -e '\e[40m\c' ; }
  130. BGRED(){    echo -e '\e[41m\c' ; }
  131. BGGREEN(){  echo -e '\e[42m\c' ; }
  132. BGYELLOW(){ echo -e '\e[43m\c' ; }
  133. BGBLUE(){   echo -e '\e[44m\c' ; }
  134. BGMAGENTA(){ echo -e '\e[45m\c' ; }
  135. BGCYAN(){   echo -e '\e[46m\c' ; }
  136. BGWHITE(){  echo -e '\e[47m\c' ; }
  137. BGORIGINAL(){ echo -e '\e[49m\c' ; }
  138. HIBLACK(){   echo -e '\e[90m\c' ; }
  139. HIRED(){     echo -e '\e[91m\c' ; }
  140. HIGREEN(){   echo -e '\e[92m\c' ; }
  141. HIYELLOW(){  echo -e '\e[93m\c' ; }
  142. HIBLUE(){    echo -e '\e[94m\c' ; }
  143. HIMAGENTA(){ echo -e '\e[95m\c' ; }
  144. HICYAN(){    echo -e '\e[96m\c' ; }
  145. HIWHITE(){   echo -e '\e[97m\c' ; }
  146. BGHIBLACK(){  echo -e '\e[100m\c' ; }
  147. BGHIRED(){    echo -e '\e[101m\c' ; }
  148. BGHIGREEN(){  echo -e '\e[102m\c' ; }
  149. BGHIYELLOW(){ echo -e '\e[103m\c' ; }
  150. BGHIBLUE(){   echo -e '\e[104m\c' ; }
  151. BGHIMAGENTA(){ echo -e '\e[105m\c' ; }
  152. BGHICYAN(){   echo -e '\e[106m\c' ; }
  153. BGHIWHITE(){  echo -e '\e[107m\c' ; }
  154.  
  155. REVVID(){ echo -e '\e[?5h\c' ; } # reverse video (set private mode)
  156. NORMVID(){ echo -e '\e[?5l\c' ; }  # normal video (reset private mode)
  157. ALTSCREEN(){ echo -e '\e[?47h\c' ; }    # alternate screen buffer
  158. NORMSCREEN(){ echo -e '\e[?47l\c' ; } # use normal screen buffer
  159. ALTSCREENSC(){ echo -e '\e[?1049h\c' ; } # save cursor+alternate screen buffer
  160.  
  161. KEYPADAPP(){       echo -e '\e=\c' ; }    #Are these usable?
  162. KEYPADNORMAL(){    echo -e '\e>\c' ; }    #don't seem so # maybe I needed strict-vt set
  163.  
  164. SCREENMEMLOCK(){   echo -e '\el\c' ; } #characters above cursor are locked in
  165. SCREENMEMUNLOCK(){ echo -e '\em\c' ; } ##in place, clear screen undoes also.
  166. FULLRESET(){ echo -e '\ec\c' ; }
  167. SOFTRESET(){ echo -e '\e[!p\c' ; }
  168. REFRESH(){ echo -e '\e[7t\c' ; }     # refresh xterm window
  169. MOVEWINDOW(){ echo -e "\e[3;${1:-0};${2:-0}t\c" ; } #move window to x,y pixels
  170. RESIZEWINDOW(){ echo -e "\e[4;${1:-620};${2:-900}t\c" ; } #resize height,width
  171. RESIZETERM(){ echo -e "\e[8;${2:-0};${1:-0}t\c" ; } #resize characters x,y
  172. HOMEWINDOW(){ MOVEWINDOW; RESIZEWINDOW; }
  173. RESTOREWINDOW(){ echo -e "\e[9;0t\c" ; }  
  174. MAXWINDOW(){     echo -e "\e[9;1t\c" ; }
  175. FULLSCREEN(){ echo -e "\e[10;1t\c" ; }
  176. FULLSCREENUNDO(){ echo -e "\e[10;0t\c" ; }
  177.  
  178.  
  179. INSERTCHAR(){ echo -e "\e[${1}@\c" ; } # ICH insert Blank characters
  180. INSERTLINE(){ echo -e "\e[${1}L\c" ; } # insert $1 lines #IL
  181. DELETELINE(){ echo -e "\e[${1}M\c" ; } # delete $1 lines #DL
  182. DELETECHAR(){ echo -e "\e[${1}P\c" ; } # delete $1 characters #DCH
  183. SCROLLUP(){   echo -e "\e[${1}S\c" ; } # scroll up $1 lines   #SU
  184. SCROLLDOWN(){ echo -e "\e[${1}T\c" ; } # scroll down $2 lines #SD ?useless?
  185. REPEAT(){ echo -e "\e[${1}b\c" ; } #REP repeat graphicchar ?useless?
  186. SCROLLZONE(){ echo -e "\e[${1};${2}r\c" ; } #DECSTBM  set scrolling region
  187. LEDSET(){   # load LEDS #DECLL
  188. case "${1:-clear}$2" in
  189. clear|default)         echo -e '\e[0q\c' ;;   # clear all
  190. numlock|num)           echo -e '\e[1q\c' ;;   # light Num Lock
  191. capslock|caps)          echo -e '\e[2q\c' ;;
  192. scrolllock|scroll)     echo -e '\e[3q\c' ;;
  193. num*off)           echo -e '\e[21q\c' ;;   # extinguish Num Lock
  194. caps*off)          echo -e '\e[22q\c' ;;
  195. scr*off)           echo -e '\e[23q\c' ;;
  196. esac
  197. }
  198. #echo 663
  199. MODE(){
  200. for M in $@
  201. do
  202. case "${M}" in
  203. insert)  echo -en '\e[4h'  ;;  # insert mode  #IRM
  204. replace) echo -en '\e[4l'  ;;  # replace mode #IRM
  205. noecho)  echo -en '\e[12h' ;;  # no echo      #SRM
  206. echo)    echo -en '\e[12l' ;;  # local cho    #SRM
  207. cr)      echo -en '\e[20l' ;;  # cr only      #LNM
  208. crlf)    echo -en '\e[20h' ;;  # send crlf    #LNM
  209. 132)     echo -en '\e[?3h' ;;  # 132 column mode #DECCOLM
  210. 80)      echo -en '\e[?3l' ;;  # 80  column mode #DECCOLM
  211. allow)   echo -en '\e[?40h' ;; # allow 80/132 switch
  212. allowoff)   echo -en '\e[?40l' ;; # don't allow 80/132 switch
  213. jump|fast)   echo -en '\e[?4l' ;; # Jump/fast  scroll mode #DECSCLM
  214. smooth|slow) echo -en '\e[?4h' ;; # smooth/slow scroll mode #DECSCLM
  215. origin)      echo -en '\e[?6h' ;; #DECOM lines are rel scroll zone
  216. originoff)   echo -en '\e[?6l' ;; #DECOM back to normal
  217. wrap)      echo -en '\e[?7h' ;; #DECAWM
  218. wrapoff)   echo -en '\e[?7l' ;; #DECAWM
  219. repeat)      echo -en '\e[?8h' ;; #DECARM auto repeat 0.5 seconds
  220. repeatoff)   echo -en '\e[?8l' ;; #DECARM
  221. esac
  222. done
  223. }
  224. CURSOR(){
  225. case "$1" in
  226. save)     echo -e '\e7\c'     ;; # save cursor   # DECSC
  227. restore)  echo -e '\e8\c'     ;; # restore cursor# DECRC
  228. show)     echo -e '\e[25?h\c' ;; # show cursor # DECTCEM
  229. hide)     echo -e '\e[25?l\c' ;; # hide cursor # DECTCEM
  230. report)                       #### Report Cursor Position CPR
  231.        INVISIBLE;echo -e '\e[6n\c'; read -rn 16 -t 1.5;INVISIBLENOT  
  232.        CURSOR backward "${#REPLY}";CURSOR backward;  # cleanup
  233.        if [[ "${REPLY:1:1}" != "[" || 'R' != "${REPLY: -1:1}" ]] then
  234.            xterm_info[6]=CURROW
  235.            xterm_info[7]=CURCOL
  236.        else
  237.            REPLY="${REPLY#*\[}"
  238.            REPLY="${REPLY%R}"
  239.            xterm_info[6]="${REPLY%;*}"
  240.            xterm_info[7]="${REPLY#*;}"
  241.       fi ;;
  242. style)  case "${2:-blink}${3:-block}" in       # set cursor style DECSCUSR
  243.         blinkblock)      echo -en '\e[1 q' ;;  # blinking block
  244.         steadyblock)     echo -en '\e[2 q' ;;  # steady block
  245.         blinkunderline)  echo -en '\e[3 q' ;;  # blinking underline
  246.         steadyunderline) echo -en '\e[4 q' ;;  # steady underline
  247.         *)               echo -en '\e[0 q' ;;
  248.         esac ;;
  249. up)       echo -en "\e[${2}A" ;; # CUU cursor up   #$2 times
  250. down)     echo -en "\e[${2}B" ;; # CUD cursor down   #$2="" ==null==default==1
  251. forward)  echo -en "\e[${2}C" ;; # CUF cursor forward  
  252. backward) echo -en "\e[${2}D" ;; # CUB cursor backward  
  253. nextline) echo -en "\e[${2}E" ;; # CNL cursor next line ?
  254. prevline) echo -en "\e[${2}F" ;; # CPL cursor preceding line ?
  255. column)   echo -en "\e[${2}G" ;; # CHA move cursor to absolute column position
  256. backtab)  echo -en "\e[${2}Z" ;;  #CBT Backward to tabstop
  257. nexttab)  echo -en "\e[${2}I" ;;  #CHT Forward $2 tab stops
  258. ind)   echo -e '\eD\c' ;;   # Index
  259. rnd)   echo -e '\eM\c' ;;   # Reverse Index
  260. nel)  echo  -e '\eE\c' ;;   # Next Line
  261. altcol)  echo -en "\e[${2}\0140"  ;; # Char position absolute HPA ???
  262. altline) echo -en "\e[${2}d"      ;; # Line Position Absolute VPA ???
  263. altpos)  echo -en "\e[${2};${3}f" ;; # Horizontal&Vertical Position HVP ???
  264. help)    echo "#CURSOR rise then run" ;;
  265. *)       echo -en "\e[${1};${2}H" ;; # CUP cursor position # default 1,1
  266. esac
  267. }
  268. #echo 731
  269. SELECTCAN(){  echo -e "\e[1\042q" ; }     #DECSCA set char. protect attribute
  270. SELECTCANNOT(){  echo -e "\e[0\042q" ; }  #DECSED DECSEL can erase
  271. ERASE(){
  272. #echo "${1:-line}_${2}"
  273. case "${1:-line}_${2}"  in
  274.     line_right)  echo -e '\e[0K\c' ;; # EL erase in line # right
  275.     line_left)   echo -e '\e[1K\c' ;; # EL erase in line # left
  276.     line_)       echo -e '\e[2K\c' ;; # EL erase in line # all
  277.     display_below)    echo -e '\e[0J\c' ;; # ED Erase in Display # below
  278.     display_above)    echo -e '\e[1J\c' ;; # ED Erase in Display # above
  279.     display_|screen_) echo -e '\e[2J\c' ;; # ED Erase in Display # all
  280.     display_saved)    echo -e '\e[3J\c' ;; # erase saved lines useless??
  281.     selective_below)    echo -e '\e[?0J\c' ;; # selective erase display
  282.     selective_above)    echo -e '\e[?1J\c' ;; # DECSED
  283.     selective_screen)   echo -e '\e[?2J\c' ;; # seems useless
  284.     selective_lineleft)  echo -e '\e[?0K\c' ;; # selective erase line
  285.     selective_lineright) echo -e '\e[?1K\c' ;; # DECSEL
  286.     selective_lineall)   echo -e '\e[?2K\c' ;; # seems useless
  287.     selective_rect) #DECSERA ERASE
  288.         shift 2  
  289.         echo -e "\e[${1};${2};${3};${4}\${\c" ;; # top left bottom right
  290.     rect_*)   # useless in terminal.app
  291.         shift  #   # DECERA Erase Rectangular Area
  292.         echo -e "\e[${1};${2};${3};${4}\$z\c" ;; # top left bottom right
  293.     char_*)
  294.         echo -e "\e[${2}X\c" ;;    # erase $2 characters backward ECH ?useless?
  295.  
  296.     screen_)  #add another way to clear screen, maybe w/o home?
  297.         CURSOR save;
  298.         echo -e "\e[H\e[J\c" # H or J etc by themselves doesn't do it.
  299.         CURSOR retore;
  300.         ;;
  301.     esac
  302. }
  303. #echo 767
  304.  
  305. Paint(){  # what I always wanted from ERASE
  306. # paint a rectangle on the screen , taking the current postion
  307. # as one corner.  then dx dy optionalcolor optionalcharacter flags
  308. # procedure will determine length, and height, and whether...
  309. # And, how to interpret dx dy, to create an appropriate corner.
  310. XTERMINFO clear #insert self gratifying remark here.
  311. # now get cursor position
  312. local integer cornerx
  313. local integer cornery
  314. CURSOR report
  315. cornerx=${xterm_info[6]}
  316. cornery=${xterm_info[7]}
  317. #now, paint this square right now with an X
  318. # since it will be needed to painted, regardlessly
  319. #PaintASqaure
  320. CURSOR save
  321. echo -e "A\c" #pedantically, we do CURSOR backward # but we don't need to
  322. CURSOR restore
  323. # now see if that works.
  324. # ok.  opposing corner , then paint that
  325. local integer ox
  326. local integer oy
  327. # we should see if it works. but 1st presume it works
  328. let ox=cornerx+$1
  329. let oy=cornery+$2
  330. CURSOR $ox $oy
  331. echo -e "B\c"
  332. CURSOR backward
  333. # fixme: use the shorter corner
  334. # finish me! dan
  335. }
  336.  
  337. wow(){  # and now fg !
  338. for X in ../* ;
  339. do
  340.   print ''
  341.   DOUBLEWIDTHLINE
  342. done
  343. }
  344.    
  345. ICONIFIED(){ # true  if iconified  
  346. INVISIBLE;echo -e '\e[11t\c'; read -rn 4 -t 1.5;INVISIBLENOT
  347. CURSOR backward "${#REPLY}";CURSOR backward;  # cleanup
  348. #echo "${REPLY:2:1}"
  349. #echo "${#REPLY}"
  350. (( "${REPLY:2:1}" == "2" ))
  351. }
  352. OSXTERMINAL(){ # true  if running inside Terminal.app
  353. INVISIBLE;echo -e '\e[7n\c'; read -rn 20 -t 1.5;INVISIBLENOT
  354. if [[ "" == "$REPLY" ]] then
  355.    (( 1 == 0 ))
  356. fi
  357. CURSOR backward "${#REPLY}";CURSOR backward;  # cleanup
  358. [[ "$REPLY" == "Mac OS X Terminal" ]]
  359. }
  360.  
  361. typeset -ai xterm_info  # an array of integers
  362. XTERMINFO()
  363. {
  364.  case "${1}" in
  365.  clear|init)
  366.      xterm_info[0]=XPOS
  367.      xterm_info[1]=YPOS
  368.      xterm_info[2]=XSIZE
  369.      xterm_info[3]=YSIZE
  370.      xterm_info[4]=TERMID
  371.      xterm_info[5]=DEVATTR
  372.      xterm_info[6]=CURROW
  373.      xterm_info[7]=CURCOL
  374.      xterm_info[8]=ROWS
  375.      xterm_info[9]=COLS
  376.  ;;
  377.  dump|print)
  378.      print "XPOS    ${xterm_info[0]}"
  379.      print "YPOS    ${xterm_info[1]}"
  380.      print "XSIZE   ${xterm_info[2]}"
  381.      print "YSIZE   ${xterm_info[3]}"
  382.      print "TERMID  ${xterm_info[4]}"
  383.      print "DEVATTR ${xterm_info[5]}"
  384.      print "CURROW  ${xterm_info[6]}"
  385.      print "CURCOL  ${xterm_info[7]}"
  386.      print "ROWS    ${xterm_info[8]}"
  387.      print "COLS    ${xterm_info[9]}"
  388.  ;;
  389.  [xX])      print ${xterm_info[0]} ;;
  390.  [yY])      print ${xterm_info[1]} ;;
  391.  [xX]size)  print ${xterm_info[2]} ;;
  392.  [yY]size)  print ${xterm_info[3]} ;;
  393.  *)         print ${xterm_info[@]} ;;
  394.  esac
  395. }
  396. XTERMINFO init
  397.  
  398. WINDOWPOS(){ # get xterm window position ( in pixels )
  399. INVISIBLE;echo -e '\e[13t\c'; read -rn 16 -t 1.5;INVISIBLENOT
  400. CURSOR backward "${#REPLY}";CURSOR backward;  # cleanup
  401. #echo "${#REPLY}"
  402. #echo "${REPLY:1:3}" |vis
  403. #[[ "${REPLY:1:3}" == "[3;" && 't' == "${REPLY: -1:1}" ]] && echo fine
  404. if [[ "${REPLY:1:3}" != "[3;" || 't' != "${REPLY: -1:1}" ]]
  405. then
  406.    echo -e "\nnot fine"
  407.    return    # return false produced error when X="$(WINDOWPOS)"
  408. fi  
  409. #echo "${REPLY:4:(( ${#REPLY} - 5 ))}"  
  410. REPLY="${REPLY:4:(( ${#REPLY} - 5 ))}" # after this REPLY is 81;48 etc
  411. xterm_info[0]="${REPLY%;*}"            
  412. xterm_info[1]="${REPLY#*;}"      
  413. }
  414. WINDOWSIZE(){ # get xterm window size (in pixels)
  415. INVISIBLE;echo -e '\e[14t\c'; read -rn 16 -t 1.5;INVISIBLENOT
  416. CURSOR backward "${#REPLY}";CURSOR backward;  # cleanup
  417. if [[ "${REPLY:1:3}" != "[4;" || 't' != "${REPLY: -1:1}" ]]
  418. then
  419.    return  
  420. fi  
  421. REPLY="${REPLY:4:(( ${#REPLY} - 5 ))}"
  422. xterm_info[2]="${REPLY%;*}"            
  423. xterm_info[3]="${REPLY#*;}"      
  424. }
  425. TERMSIZE(){ # get xterm size of text area window size (in characters)
  426. INVISIBLE;echo -e '\e[18t\c'; read -rn 16 -t 1.5;INVISIBLENOT
  427. CURSOR backward "${#REPLY}";CURSOR backward;  # cleanup
  428. if [[ "${REPLY:1:3}" != "[8;" || 't' != "${REPLY: -1:1}" ]]
  429. then
  430.    return  
  431. fi  
  432. REPLY="${REPLY:4:(( ${#REPLY} - 5 ))}"
  433. xterm_info[8]="${REPLY%;*}"            
  434. xterm_info[9]="${REPLY#*;}"      
  435. }
  436. XTERMINALID(){
  437. INVISIBLE;echo -e '\eZ\c'; read -rn 16 -t 1.5;INVISIBLENOT
  438. CURSOR backward "${#REPLY}";CURSOR backward;  # cleanup
  439. if [[ "${REPLY:3:4}" == "1;2c" ]] then
  440.     xterm_info[4]=1     # string for terminal.app at least
  441. else
  442.     xterm_info[4]=TERMID
  443. fi
  444. }
  445. DECDEVATTR(){
  446. INVISIBLE;echo -e '\e[0c\c'; read -rn 16 -t 1.5;INVISIBLENOT
  447. CURSOR backward "${#REPLY}";CURSOR backward;  # cleanup
  448. #SEND DEVICE Attributes (PRIMARY DA) ... depends on decTerminalID resource
  449. REPLY="${REPLY#*\[}"
  450. if [ "${REPLY}" == "" ] ; then
  451.     xterm_info[5]=DEVATTR
  452. elif [ "${REPLY}"     == "?1;2c" ] ; then
  453.     xterm_info[5]=1          # VT100 with ADVANCED Video Option
  454. elif [ "${REPLY}"     == "?1;0c" ] ; then
  455.     xterm_info[5]=2          # VT101 with NO Options
  456. elif [ "${REPLY}"     == "?6c" ] ; then
  457.     xterm_info[5]=3          # VT102
  458. elif [ "${REPLY:0:4}" == "?60;" ] ; then
  459.     xterm_info[5]=4       # VT220
  460.     REPLY="{$REPLY:4}"    # remaining parameters in REPLY
  461. else
  462.     xterm_info[5]=DEVATTR
  463. fi
  464. }
  465.  
  466. ENQUIRE(){
  467. INVISIBLE;echo -e '\05'; read -rn 16 -t 1.5;INVISIBLENOT
  468. CURSOR backward "${#REPLY}";CURSOR backward;  # cleanup
  469. #REPLY is now answerbackString..if there is one.
  470. }
  471. DECREQTERM(){  # request terminal parameters #DECREQTPARM
  472. INVISIBLE;echo -en '\e[1x'; read -rn 30 -t 0.8 ;INVISIBLENOT
  473. CURSOR backward "${#REPLY}";CURSOR backward;  # cleanup
  474. if [[ "$REPLY" == "" ]] then
  475.   return
  476. elif [[ "${REPLY:1:3}" != "[3;" || 't' != "${REPLY: -1:1}x" ]] then
  477.     REPLY="${REPLY%x}"
  478.     REPLY="${REPLY#*3;}" #REPLY is now paramaters
  479.     echo "$REPLY" |vis
  480. fi
  481. }
  482. emit(){  echo -e "${1}\c" && sleep ${2:-0.32} ; }
  483. emitline(){   echo -en "$@ " ; sleep 1.41 ; }
  484.  
  485. WINDOWPOS
  486. MAXWINDOW
  487. HOMEWINDOW
  488. flash
  489. sleep 3.3
  490. run  
  491. sleep 10  && RESTOREWINDOW || exit
  492.  
  493.  
  494.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement