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? :-)
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...
:-(
-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
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 fiRe:Done :-)
slanning on 2004-07-13T13:35:42
if [ "$DISPLAY" ]; then
xset -b
fiRe: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:Now, have yourBASHRC_RUN=upcoming xterm -bg black -fg... .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.