public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* Is there a way to spawn processes from the XWin login shell?
@ 2013-03-23  0:02 Thiago Padilha
  2013-03-27 15:52 ` Thiago Padilha
  0 siblings, 1 reply; 4+ messages in thread
From: Thiago Padilha @ 2013-03-23  0:02 UTC (permalink / raw)
  To: cygwin-xfree

XWin uses a login shell to configure its environment when it starts
up, and processes spawned from the tray icon inherit XWin environment
so they don't have to be spawned from login shells. Is there a way to
achieve the same effect without using a tray icon?

For example, can I have a desktop shortcut that launches a terminal
emulator with a simple interactive(non-login) shell and still have it
inherit the currently running XWin environment like it was started
from the tray icon?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there a way to spawn processes from the XWin login shell?
  2013-03-23  0:02 Is there a way to spawn processes from the XWin login shell? Thiago Padilha
@ 2013-03-27 15:52 ` Thiago Padilha
  2013-03-27 17:36   ` Jon TURNEY
  0 siblings, 1 reply; 4+ messages in thread
From: Thiago Padilha @ 2013-03-27 15:52 UTC (permalink / raw)
  To: cygwin-xfree

Actually, I use windows shortcut with the following command line:
C:\cygwin\bin\run.exe /usr/bin/zsh -l -c 'exec startxwin'

I'm guessing the startxwin is responsible for setting up the login
environment. Still, the only way to start processes inheriting from
the login shell seems to be by using the tray icon.

It would be nice to have a startxwin flag that did that, eg:

startxwin -command 'urxvtc -e zsh' # instead of starting a new xwin
instance, this would send a command to be spawned by the running login
shell

which would have the same effect as select a .XWinrc menu entry with
the following 'urxvtc -e zsh'

On Fri, Mar 22, 2013 at 9:02 PM, Thiago Padilha <tpadilha84@gmail.com> wrote:
> XWin uses a login shell to configure its environment when it starts
> up, and processes spawned from the tray icon inherit XWin environment
> so they don't have to be spawned from login shells. Is there a way to
> achieve the same effect without using a tray icon?
>
> For example, can I have a desktop shortcut that launches a terminal
> emulator with a simple interactive(non-login) shell and still have it
> inherit the currently running XWin environment like it was started
> from the tray icon?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there a way to spawn processes from the XWin login shell?
  2013-03-27 15:52 ` Thiago Padilha
@ 2013-03-27 17:36   ` Jon TURNEY
  2013-03-27 19:37     ` Thiago Padilha
  0 siblings, 1 reply; 4+ messages in thread
From: Jon TURNEY @ 2013-03-27 17:36 UTC (permalink / raw)
  To: cygwin-xfree; +Cc: tpadilha84

On 23/03/2013 00:02, Thiago Padilha wrote:
> XWin uses a login shell to configure its environment when it starts
> up, and processes spawned from the tray icon inherit XWin environment
> so they don't have to be spawned from login shells. Is there a way to
> achieve the same effect without using a tray icon?

Yes.

> For example, can I have a desktop shortcut that launches a terminal
> emulator with a simple interactive(non-login) shell and still have it
> inherit the currently running XWin environment like it was started
> from the tray icon?

To inherit implies that it is a child of XWin, so no.

However, you can create a process with an identical login environment by
requesting the shell to create a login environment.

On 27/03/2013 15:52, Thiago Padilha wrote:
> Actually, I use windows shortcut with the following command line:
> C:\cygwin\bin\run.exe /usr/bin/zsh -l -c 'exec startxwin'
> 
> I'm guessing the startxwin is responsible for setting up the login
> environment. Still, the only way to start processes inheriting from
> the login shell seems to be by using the tray icon.

Reading 'man zsh' would save you having to guess.

The login environment is nothing to do with startxwin.  You are requesting zsh
to create the login environment with the '-l' flag.

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Is there a way to spawn processes from the XWin login shell?
  2013-03-27 17:36   ` Jon TURNEY
@ 2013-03-27 19:37     ` Thiago Padilha
  0 siblings, 0 replies; 4+ messages in thread
From: Thiago Padilha @ 2013-03-27 19:37 UTC (permalink / raw)
  To: cygwin-xfree

As you have shown me, I probably overcomplicated my question. It would
have been simpler if I asked: 'can I make XWin start child processes
without using the tray icon?' :)

The reason I was trying to do that is because my zsh login scripts set
things that only make sense once in a traditional XServer
lifetime(setxkbmap,xmodmap,ssh-agent), not to mention xmodmap
complains the second time it is ran. I managed to refactor the scripts
so they can be run many times in the same x-server so everything is
fine now.

In any case, you should consider implementing a flag to XWin.exe so it
can spawn processes in an already running instance of XWin.exe, as
this would bring XWin more close to the spirit of traditional X window
managers where a login environment is only created once per session.

Anyway, thanks for your help Jon

On Wed, Mar 27, 2013 at 1:41 PM, Jon TURNEY <jon.turney@dronecode.org.uk> wrote:
> On 23/03/2013 00:02, Thiago Padilha wrote:
>> XWin uses a login shell to configure its environment when it starts
>> up, and processes spawned from the tray icon inherit XWin environment
>> so they don't have to be spawned from login shells. Is there a way to
>> achieve the same effect without using a tray icon?
>
> Yes.
>
>> For example, can I have a desktop shortcut that launches a terminal
>> emulator with a simple interactive(non-login) shell and still have it
>> inherit the currently running XWin environment like it was started
>> from the tray icon?
>
> To inherit implies that it is a child of XWin, so no.
>
> However, you can create a process with an identical login environment by
> requesting the shell to create a login environment.
>
> On 27/03/2013 15:52, Thiago Padilha wrote:
>> Actually, I use windows shortcut with the following command line:
>> C:\cygwin\bin\run.exe /usr/bin/zsh -l -c 'exec startxwin'
>>
>> I'm guessing the startxwin is responsible for setting up the login
>> environment. Still, the only way to start processes inheriting from
>> the login shell seems to be by using the tray icon.
>
> Reading 'man zsh' would save you having to guess.
>
> The login environment is nothing to do with startxwin.  You are requesting zsh
> to create the login environment with the '-l' flag.
>
> --
> Jon TURNEY
> Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-27 17:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-23  0:02 Is there a way to spawn processes from the XWin login shell? Thiago Padilha
2013-03-27 15:52 ` Thiago Padilha
2013-03-27 17:36   ` Jon TURNEY
2013-03-27 19:37     ` Thiago Padilha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).