| 1 | #!/bin/bash |
| 2 | room="room.txt"; |
| 3 | nick="Harvie" |
| 4 | |
| 5 | PS3="Choose: " |
| 6 | select i in $(ls *) quit |
| 7 | do |
| 8 | [ $i = "quit" ] && exit 0 |
| 9 | echo "You chose $i" |
| 10 | done |
| 11 | |
| 12 | |
| 13 | H="$(( $LINES-10 ))"; |
| 14 | W="$(( $COLUMNS-2 ))"; |
| 15 | |
| 16 | echo $W |
| 17 | echo $H |
| 18 | exit |
| 19 | |
| 20 | chat_send_msg() { |
| 21 | dialog --inputbox "Enter message" "$H" "$W" 2>>"1" |
| 22 | if [ "$?" != 0 ]; then exit; fi; |
| 23 | echo >>"$room" |
| 24 | |
| 25 | } |
| 26 | |
| 27 | while true; do |
| 28 | dialog --tailbox "$room" "$H" "$W"; |
| 29 | if [ "$?" != 0 ]; then exit; fi; |
| 30 | chat_send_msg "$room" "$nick"; |
| 31 | done; |