Re: Detach Icedove from xterm itself called from terminal.

2011-12-03 Thread Chris Davies
Iuri Guilherme dos Santos Martins  wrote:
> Your script is very good, by the way.
> Thanks for sharing :D

Thank you, and a pleasure.
Chris


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/qt0qq8xjhg@news.roaima.co.uk



Re: Detach Icedove from xterm itself called from terminal.

2011-12-02 Thread Iuri Guilherme dos Santos Martins

Em 02-12-2011 17:36, Mart Frauenlob escreveu:

ok, after reading the online help for xterm:

as it calls a shell normally, why not let the shell just execute one 
command with the '-c' option?


xterm -e sh -c 'icedove &'

how does that behave?
xterm should close after the shell closes, right?



Actually that would make xterm closes when icedove closes


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed9394c.8050...@gmail.com



Re: Detach Icedove from xterm itself called from terminal.

2011-12-02 Thread Mart Frauenlob

On 02.12.2011 17:09, Iuri Guilherme dos Santos Martins wrote:

Em 01-12-2011 17:28, Mart Frauenlob escreveu:


why use a shubshell for icedove, we expect to use the output for
something?
better use single quotes to protect the `&' to be parsed by the shell
and to prevent from word splitting, so we keep it as one 'word' option
for xterm.

echo exit > xterm -e 'icedove &' &

(untested - no X here)



I know what you mean, but that seems either to send the exit command
before the icedove or maybe it send the exit command to icedove itself,
because nothing does appear on the task manager (and I'm lacking a debug
feature to see what is happening). Double quotes aren't working neither.




ok, after reading the online help for xterm:

as it calls a shell normally, why not let the shell just execute one 
command with the '-c' option?


xterm -e sh -c 'icedove &'

how does that behave?
xterm should close after the shell closes, right?


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed936cb.7090...@chello.at



Re: Detach Icedove from xterm itself called from terminal.

2011-12-02 Thread Iuri Guilherme dos Santos Martins

Your script is very good, by the way.

I used that to fix some errors i had in my Openbox menu that I was 
procrastinating to solve (nothing that couldn't be done by command line 
anyways).


Thanks for sharing :D


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed92732.1080...@gmail.com



Re: Detach Icedove from xterm itself called from terminal.

2011-12-02 Thread Chris Davies
Iuri Guilherme dos Santos Martins  wrote:
> Well, if you are willing to learn bash then what I would recommend is 
> exactly what Chris said [...]

You don't need to learn bash to use the script I've offered. (Others here
can sanity-check it so you don't need to "trust" my coding.)

Chris


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/b6enq8xg63@news.roaima.co.uk



Re: Detach Icedove from xterm itself called from terminal.

2011-12-02 Thread Iuri Guilherme dos Santos Martins
Well, the way that you could produce a bash script file and then run it 
with only one command would be like this:


echo "#!/bin/bash \nicedove & \nexit" > script.sh && bash script.sh && 
rm script.sh


Just make sure your Lua interpreter can understand the &&

What that does is create a file called script.sh in the current 
directory (>), run it (bash), and the attempt to remove it (rm).


The file would look like this:

#!/bin/bash
icedove &
exit

(Assuming there's a bash in your /bin)

That's not the better way to do it, I am sure if I had studied more bash 
script I would have a better solution (especially without using 
temporary files).



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed8fd26.8090...@gmail.com



Re: Detach Icedove from xterm itself called from terminal.

2011-12-02 Thread Iuri Guilherme dos Santos Martins

Em 01-12-2011 17:28, Mart Frauenlob escreveu:


why use a shubshell for icedove, we expect to use the output for 
something?
better use single quotes to protect the `&'  to be parsed by the shell 
and to prevent from word splitting, so we keep it as one 'word' option 
for xterm.


echo exit > xterm -e 'icedove &' &

(untested - no X here)


I know what you mean, but that seems either to send the exit command 
before the icedove or maybe it send the exit command to icedove itself, 
because nothing does appear on the task manager (and I'm lacking a debug 
feature to see what is happening). Double quotes aren't working neither.



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed8f835.4010...@gmail.com



Re: Detach Icedove from xterm itself called from terminal.

2011-12-01 Thread Paul Isambert

Le 01/12/2011 20:36, Iuri Guilherme dos Santos Martins a écrit :

 Now I get it,

 You must use the same command i sent you, however in the Lua language
 you should have an option to detach the command from the terminal


Unfortunately, there is no such thing.


 That should work (assuming that now i did understand what you are
 doing).


You did :)

Paul



Re: Detach Icedove from xterm itself called from terminal.

2011-12-01 Thread Mart Frauenlob

On 30.11.2011 17:25, Iuri Guilherme dos Santos Martins wrote:

Well, the example i gave you opens another terminal (xterm) and opens
icedove without closing the first terminal nor the second (assuming that
you was using xterm in the first place).

If you want the terminal to be closed, you may use:

echo exit > xterm -e `icedove &` & (if you want the xterm you use to
open icedove closes)




why use a shubshell for icedove, we expect to use the output for something?
better use single quotes to protect the `&'  to be parsed by the shell 
and to prevent from word splitting, so we keep it as one 'word' option 
for xterm.


echo exit > xterm -e 'icedove &' &

(untested - no X here)


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed7e376.9010...@chello.at



Re: Detach Icedove from xterm itself called from terminal.

2011-12-01 Thread Iuri Guilherme dos Santos Martins

Now I get it,

You must use the same command i sent you, however in the Lua language 
you should have an option to detach the command from the terminal that 
you are using, and to close the terminal.


That should work (assuming that now i did understand what you are doing).


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed7d740.1010...@gmail.com



Re: Detach Icedove from xterm itself called from terminal.

2011-12-01 Thread Paul Isambert

 Em 01-12-2011 11:08, Chris Davies escreveu:
> Paul Isambert wrote:
>
>> But Icedove still stays attached to the first terminal...
>>
> Just to check, you want to be able to start icedove from the command
> line in (say) an xterm, but have it continue to run even when that
> xterm is closed?


No: launch icedove from a terminal itself launched from a terminal. I
have a Lua script which calls "os.execute()", and as Clive
remarked, this calls a shell. The Lua script itself is called from a
terminal, and I would like everything to close when the program is
launched. I made the double terminal example, because that's basically
the same problem (it seems to me).



Le 01/12/2011 16:59, Iuri Guilherme dos Santos Martins a écrit :

 Well, if you are willing to learn bash then what I would recommend is
 exactly what Chris said: you run an external script (whose first line
 would be #!/bin/bash) with the necessary commands to make exactly what
 you wanted.


Yeah, I think learning bash will be definitely simpler. But I love
Lua... and don't really want to learn a new language, even though now
that I use Debian, learning bash won't be wasting time...

Paul



Re: Detach Icedove from xterm itself called from terminal.

2011-12-01 Thread Iuri Guilherme dos Santos Martins

Em 01-12-2011 11:08, Chris Davies escreveu:

Paul Isambert  wrote:
   

But Icedove still stays attached to the first terminal...
 

Just to check, you want to be able to start icedove from the command
line in (say) an xterm, but have it continue to run even when that xterm
is closed? And you're not really interested in stdout/stderr.

I use thunderbird rather than icedove but this "just works" here:

 [xterm window]
 $ thunderbird&

 [wait for thunderbird to start]
 $ ^D # or "exit"

 [thunderbird continues to run]


I have a script that I use to start GUI applications
from the command line, which I've made available at
http://www.roaima.co.uk/stuff/2011/12/01/x.sh

You would save it as "x" somewhere in your PATH ($HOME/bin, perhaps),
and make it executable (chmod a+x /your/path/to/x) and then use it
something like this:

 x icedove

Chris


   
Well, if you are willing to learn bash then what I would recommend is 
exactly what Chris said: you run an external script (whose first line 
would be #!/bin/bash) with the necessary commands to make exactly what 
you wanted.


I was trying to attempt a solution that does not use any external 
commands, but only now I realized that you are opening xterm, which 
would not be necessary.



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed7a457.1080...@gmail.com



Re: Detach Icedove from xterm itself called from terminal.

2011-12-01 Thread Chris Davies
Paul Isambert  wrote:
> But Icedove still stays attached to the first terminal...

Just to check, you want to be able to start icedove from the command
line in (say) an xterm, but have it continue to run even when that xterm
is closed? And you're not really interested in stdout/stderr.

I use thunderbird rather than icedove but this "just works" here:

[xterm window]
$ thunderbird &

[wait for thunderbird to start]
$ ^D # or "exit"

[thunderbird continues to run]


I have a script that I use to start GUI applications
from the command line, which I've made available at
http://www.roaima.co.uk/stuff/2011/12/01/x.sh

You would save it as "x" somewhere in your PATH ($HOME/bin, perhaps),
and make it executable (chmod a+x /your/path/to/x) and then use it
something like this:

x icedove

Chris


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/hcekq8xc0j@news.roaima.co.uk



Re: Detach Icedove from xterm itself called from terminal.

2011-12-01 Thread Iuri Guilherme dos Santos Martins

The first terminal you say is supposed to be closed?


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed76b6e.4010...@gmail.com



Re: Detach Icedove from xterm itself called from terminal.

2011-11-30 Thread Paul Isambert

Le 30/11/2011 17:02, Clive Standbridge a écrit :

 I don't know anything about Lua, but searching around suggests that
 os.execute executes its command in a shell, not directly. In that case
 you should be able to use a command like

 icedove &


No, that didn't work, the terminal closes and icedove never opens.


 but if that causes icedove to be closed immediately, you could try

 nohup icedove &


Doesn't work either. However, without the ampersand, the terminal
doesn't close but at least Icedove isn't attached to it, so I can close
the terminal manually.

Le 30/11/2011 17:25, Iuri Guilherme dos Santos Martins a écrit :

 Well, the example i gave you opens another terminal (xterm) and opens
 icedove without closing the first terminal nor the second (assuming
 that you was using xterm in the first place).

 If you want the terminal to be closed, you may use:

 echo exit > xterm -e `icedove &` & (if you want the xterm you use to
 open icedove closes)


But Icedove still stays attached to the first terminal...

I know it would be just simpler to write everything as a shell script
directly, but I'm unfamiliar with the language, whereas I have some
experience in Lua.

Thanks to both,
Paul



Re: Detach Icedove from xterm itself called from terminal.

2011-11-30 Thread Iuri Guilherme dos Santos Martins
Well, the example i gave you opens another terminal (xterm) and opens 
icedove without closing the first terminal nor the second (assuming that 
you was using xterm in the first place).


If you want the terminal to be closed, you may use:

echo exit > xterm -e `icedove &` & (if you want the xterm you use to 
open icedove closes)



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed65909.4040...@gmail.com



Re: Re: Detach Icedove from xterm itself called from terminal.

2011-11-30 Thread Clive Standbridge
Paul Isambert wrote:

> Thanks Clive for your help. Unfortunately Icedove stays attached to the
> uppermost terminal (which I want to close too, perhaps that wasn't
> clear). Even with the simplest form:
> 
>   bash --rcfile <(echo icedove \&)
> 
> when I close the terminal, it closes Icedove.
> 
> But at least I have learnt something!

and in reply to Iuri Guilherme dos Santos Martins, Paul Isambert wrote:
> Thank you Iuri, but the terminal still stays open.
> 
> What I want to do is the following: I have a Lua script which lets me
> selects programs, then calls them with "os.execute()", and the
> terminal where the Lua script runs closes too. Only with Icedove it
> stays attached, so I'm trying very hard to detach it so the terminal can
> close.


Hi Paul,

I've obviously misunderstood your intention (I thought you wanted to
keep the second (and possibly the first) terminal open at an
interactive prompt).

It looks easier now.
I don't know anything about Lua, but searching around suggests that
os.execute executes its command in a shell, not directly. In that case
you should be able to use a command like

  icedove &

but if that causes icedove to be closed immediately, you could try

  nohup icedove &

Note I can't test any of this because I don't have LUA installed.

I hope this helps. Otherwise I'm out of ideas.

-- 
Cheers,
Clive


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2030160216.ga18...@rimmer.esmertec.com



Re: Detach Icedove from xterm itself called from terminal.

2011-11-30 Thread Paul Isambert

Le 30/11/2011 15:52, Iuri Guilherme dos Santos Martins a écrit :

 I did not understand what you wanted, but i guess

 `xterm -e `icedove &` ` is close to the command you are looking for.

 The `` are used by bash to open a sub shell. (Assuming you are using
 bash).


Thank you Iuri, but the terminal still stays open.

What I want to do is the following: I have a Lua script which lets me
selects programs, then calls them with "os.execute()", and the
terminal where the Lua script runs closes too. Only with Icedove it
stays attached, so I'm trying very hard to detach it so the terminal can
close.

Best,
Paul



Re: Detach Icedove from xterm itself called from terminal.

2011-11-30 Thread Iuri Guilherme dos Santos Martins

I did not understand what you wanted, but i guess

`xterm -e `icedove &` ` is close to the command you are looking for.

The `` are used by bash to open a sub shell. (Assuming you are using bash).


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed64341.9030...@gmail.com



Re: Detach Icedove from xterm itself called from terminal.

2011-11-30 Thread Paul Isambert

Le 30/11/2011 14:29, Clive Standbridge a écrit :

Paul Isambert wrote:

Hello there,


When started from gnome-terminal, Icedove stays attached to it. I can
detach it by executing "icedove&". The problem is, I can't seem to do
that recursively, i.e. from the terminal call another terminal which
calls "icedove&". The following works: "xterm -e 'icedove'" (with
Icedove attached to xterm), but "xterm -e 'icedove&'" doesn't (xterm
starts and closes immediately).

Any idea?


Hi Paul,

First, about the error. Given the -e option, xterm runs the next
argument instead of the shell that it would run by default. So it's
trying to run an executable called 'icedove&', can't find it, and
exits.

The '&' is shell syntax; you need to run a shell in the xterm. The
shell would need to both run the icedove command in the background,
and produce an interactive prompt. I don't know if there is a
straightforward way of doing that. The best I can think of is

   xterm -e bash --rcfile<(echo icedove \&)

or if you want the usual initialisation files to run, you could do

   xterm -e bash --rcfile<(cat /etc/bash.bashrc ~/.bashrc; echo icedove \&)

or use a dedicated rcfile:

   xterm -e bash --rcfile ~/.my-icedove-rcfile

where ~/.my-icedove-rcfile contains

   . /etc/bash.bashrc
   . ~/.bashrc
   icedove&


There are a couple of things I haven't figured out:
This does not to allow you to bring the icedove to the foreground.
Nor does it seem to show stdout/stderr from icedove in the xterm, which
I guess you want.


Thanks Clive for your help. Unfortunately Icedove stays attached to the 
uppermost terminal (which I want to close too, perhaps that wasn't 
clear). Even with the simplest form:


  bash --rcfile <(echo icedove \&)

when I close the terminal, it closes Icedove.

But at least I have learnt something!

Best,
Paul


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed63e54.9070...@free.fr



Re: Detach Icedove from xterm itself called from terminal.

2011-11-30 Thread Clive Standbridge
Paul Isambert wrote:
> Hello there,
> 
> 
> When started from gnome-terminal, Icedove stays attached to it. I can
> detach it by executing "icedove &". The problem is, I can't seem to do
> that recursively, i.e. from the terminal call another terminal which
> calls "icedove &". The following works: "xterm -e 'icedove'" (with
> Icedove attached to xterm), but "xterm -e 'icedove &'" doesn't (xterm
> starts and closes immediately).
> 
> Any idea?


Hi Paul,

First, about the error. Given the -e option, xterm runs the next
argument instead of the shell that it would run by default. So it's
trying to run an executable called 'icedove &', can't find it, and
exits.

The '&' is shell syntax; you need to run a shell in the xterm. The
shell would need to both run the icedove command in the background,
and produce an interactive prompt. I don't know if there is a
straightforward way of doing that. The best I can think of is

  xterm -e bash --rcfile <(echo icedove \&)

or if you want the usual initialisation files to run, you could do

  xterm -e bash --rcfile <(cat /etc/bash.bashrc ~/.bashrc; echo icedove \&)

or use a dedicated rcfile:

  xterm -e bash --rcfile ~/.my-icedove-rcfile

where ~/.my-icedove-rcfile contains

  . /etc/bash.bashrc
  . ~/.bashrc
  icedove &


There are a couple of things I haven't figured out:
This does not to allow you to bring the icedove to the foreground.  
Nor does it seem to show stdout/stderr from icedove in the xterm, which
I guess you want.


Hopefully someone will provide a better answer.


-- 
Cheers,
Clive


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2030132934.ga9...@rimmer.esmertec.com



Detach Icedove from xterm itself called from terminal.

2011-11-30 Thread Paul Isambert

Hello there,

When started from gnome-terminal, Icedove stays attached to it. I can 
detach it by executing "icedove &".
The problem is, I can't seem to do that recursively, i.e. from the 
terminal call another terminal which calls "icedove &". The following 
works: "xterm -e 'icedove'" (with Icedove attached to xterm), but "xterm 
-e 'icedove &'" doesn't (xterm starts and closes immediately).


Any idea?

Best,
Paul


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4ed60166.5040...@free.fr