#!/bin/bash # needs # - package xvfb, x11-utils # - xsendevent in http://colaz.net/files/xsendkey/ # - a file ~/.fetchnotesp with keys of you password one per line, # in xsendevent syntax. You can try by typing: xsendevent # where LETTER can be x (x), Shift+x (X), Shift+4 ($), etc... # you can change the number below in case of conflict DISPLAY=:7 server="Xvfb $DISPLAY -screen 0 320x200x24 -ac" serverpid=/tmp/xvfb$DISPLAY # Start in-memory server if needed if test ! -e $serverpid -o ! -e /proc/`cat $serverpid`/cmdline; then $server /dev/null 2>&1 & echo $! >$serverpid fi # run fetchnotes with the (optional) provided args in background fetchnotes "$@" 2>/dev/null & fetchnotespid=$! # wait for prompt to appear, and type the password in it id= while test -z "$id"; do sleep 1 # if fetchnotes died, return its error code if test ! -e /proc/$fetchnotespid; then exit `wait $fetchnotespid` ; fi id=`xwininfo -name 'Lotus Notes' -int 2>/dev/null|grep '^xwininfo:'| cut -f 4 -d ' '` done if test -e ~/.fetchnotesp then while read key; do xsendkey -window $id "$key"; done <~/.fetchnotesp xsendkey -window $id Return else echo "Please make a ~/.fetchnotesp" fi # waith for fetchnotes termination wait $fetchnotespid