Re: dot bash_logout

Dieter Van Eessen <[email protected]> Thu, 8 Jan 2015 09:46:20 +0100
Newsgroups gmane.comp.window-managers.ratpoison.devel
Message-ID <CAC2TPPhDzOPR0g8WkEVZshY7STS2HYHts7FLnKcV=qt8DOUc7Q@mail.gmail.com>
Hello Mike,

Thanks for the reply, removing 'exec' from the dotfiles indeed solved the
problem.
I had used these because nearly every 'HOWTO' on the web used exec (which
is a really lame excuse...).

Again realizing I'm lacking far behind...
Sorry to waste your time, I should have read the man pages.

kind regards,
Dieter

On Mon, Jan 5, 2015 at 11:38 PM, Mike Fabre <mike-0PtuWIJygRu6c6uEtOJ/[email protected]> wrote:

> On January 6, 2015 12:49:05 AM AEDT, Dieter Van Eessen <
> [email protected]> wrote:
> > Hello,
> >
> > Just joined the list. Got a question regarding the shutdown of
> > ratpoison
> > and xserver.
> > At the moment I'm working with debian 8 and I 'startx' in .profile
> > after
> > which I configure keyboard, visuals and start ratpoison in .xinitrc.
> >
> > Quitting ratpoison results in shutdown of xserver (last client has
> > finished) and a log out of the system. All behavior in the last
> > sentence is
> > default.
> >  if [ -z "$DISPLAY"] && [ $(tty) = /dev/tty1 ]; then
> >      exec startx
> >  fi
> > Been using this for a while and I'm happy with it :)
> >
> > Now I've considered starting an emacs-daemon when I login (personal
> > preference) in .profile and I would like to shut it down when logging
> > out.
> > I've added emacsclient -e '(kill-emacs)' to .bash_logout to shut it
> > down.
> > This command seems to work fine when I log in and exit in another tty
> > (eg.
> > tty2).
> >
> > But when I log in on a tty which automatically starts an X-server, the
> > commands in .bash_logout doesn't seem to have any effect when the
> > shutdown
> > of the X-server forces you to log out.
>
> Sounds to me like the emacsclient command should go on your  .xinitrc file
> after the ratpoison call so that when ratpoison finishes it kills emacs
> from inside the X session. This will not affect your other ttys though,
> only your X sessions.
>
> > Thus the following questions:
> > -Why does :quit ting ratpoison shut down the X-server? Most likely
> > answer
> > is because ratpoison is it's last client... but I'm not sure. It would
> > be
> > usefull to remain on console where the configs provided by xmodmap
> > (and
> > xrdb) are still available.
>
> X shuts down when the .xinitrc call returns, so once everything on that
> file (probably just ratpoison) is finished the X server shuts down.
>
> > -Why shutting down the X-server result in logging off? Xserver is
> > 'just a
> > program' started when logging in, why don't I return to the tty
> > console
> > where I am logged in?
>
> Because you used exec for the startx call, which replaces the currently
> logged in shell with just the startx command.
>
> > -After x-server shuts down, it forces the log out somehow. Why doesn't
> > this
> > logout take the commands in .bash_logout? After all, you are logging
> > out of
> > a login-shell.
>
> Because bash stopped running (without logging out) when you ran exec,
> explained better above.
>
> > That's about it...
> > I'd prefer NOT to tweak things with the ratpoison 'quit'-hook: The
> > emacs-server has got nothing to do with my window manager so I'd like
> > to
> > keep their configurations (startup, stop,...) separated.
> > (If I wasn't so depending on conkeror web browser to view pdf's and
> > websites, I'd only need the xserver for it's xmodmap...)
>
>
> --
> Mike Abrahall
>
> Sent from my Android phone with K-9 Mail. Please excuse my brevity.
>



-- 
gtz,
Dieter VE

_______________________________________________
Ratpoison-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/ratpoison-devel