Displaying my upcoming events

cog on 2004-07-12T12:59:28

When I log in on my computer (or do I log on in my computer?), four xterms are automatically started... one of them displays my upcoming events... the process is simple enough; on .bash_profile:

touch .upcoming

and on .bashrc:

if [ -f .upcoming ]; then
  rm .upcoming 2>/dev/null
  if [ $? == 0 ]; then
    upcoming
  fi
fi

(upcoming is the script that does the rest)

The only problem is... how on Earth do I get it to always be the terminal on the top left corner to do that? :-) Apparently, it's kind of random... :-)

Ideas, anyone? :-)


-geometry

slanning on 2004-07-12T13:19:16

I think if you start that xterm first and use the -geometry option it should work.
xterm -geometry WIDTHxHEIGHT+0+0

Re:-geometry

cog on 2004-07-12T13:25:28

Oops... I think I wasn't clear enough... I get the four xterms the way I want
them... they are four, and together they fill up the screen (kind of like
dividing it into a grid).

My problem is how to select the one of them that starts the upcoming events
script... sometimes it's the one on the top left corner, others it's the one
in the bottom right corner, etc...

It seems that all the four xterms are started at the same time, so only the
first that succeeds in deleting the file gets to run the script... I would
like it to be the one on the top left corner, independently of their starting
order... :-|

And I don't really know how to do it... :-|

Re:-geometry

melopt on 2004-07-12T14:28:14

xterm -geometry WHEREYOUWaNTED -e script.sh

and have script.sh have the code you posted.

Remove it from .bashrc

Re:-geometry

cog on 2004-07-12T16:27:53

Only two problems with that solution... :-(

1) The Bash switch -e executes the command /and/ terminates the shell... I
want it to be fully operational afterwards...

2) The xterms aren't opened by me... I simply logged out and saved the
configuration with the xterms opened (although that should
be in some configuration file I'm not aware of...)

Re:-geometry

cog on 2004-07-12T13:31:48

Here's a link to what I'm striving for :-)

And another to what I sometimes get... :-(

Done :-)

cog on 2004-07-13T10:02:15

First, I tried searching for the place where the information about my xterms was written... I tried changing that a little, with -geometry and such, but that didn't work out the way I intended...

Then, I decided to go for a different approach... my .bash_profile now reads:

# four xterms to start with
xterm -bg black -fg white -vb +sk -geometry +0+0 -e " upcoming ; bash "
xterm -bg black -fg white -vb +sk -geometry +507+0
xterm -bg black -fg white -vb +sk -geometry +0+340
xterm -bg black -fg white -vb +sk -geometry +507+340

Notice the trick with the -e switch ;-) Since the xterm would automatically exit after the completion of the command, the command now includes a new bash :-) Nice, uh? :-)

Thanks to slanning and to melopt for the ideas :-)

jac

PS: Now I just have to find a way to run those commands *only* when in graphical mode! Shouldn't be too hard... :-)

Re:Done :-)

slanning on 2004-07-13T13:34:57

example:

if [ "$DISPLAY" ]; then xset -b fi

Re:Done :-)

slanning on 2004-07-13T13:35:42

if [ "$DISPLAY" ]; then
    xset -b
fi

Re:Done :-)

cog on 2004-07-13T13:41:26

Awesome :-) Thanks :-)

Re:Done :-)

jmm on 2004-07-13T14:57:56

You can avoid the -e trick by using an environment variable:
BASHRC_RUN=upcoming xterm -bg black -fg ...
Now, have your .bashrc test whether that variable is set and take special action if it is. You might also find it useful to set the title bar, either in the .bashrc code or in your xterm line.