ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RP] dot bash_logout


From: Jeff Abrahamson
Subject: Re: [RP] dot bash_logout
Date: Tue, 6 Jan 2015 09:02:23 +0100

The thing that X is waiting on is its init script finishing, which includes .xinitrc. The thing that blocks that is ratpoison. If emacsserver appeared after ratpoison, it wouldn't start until rp had exited. (Unless X init has changed since last I traced through it. Please correct me if I'm wrong on this. I imagine it could change between distros even.)

The simplest (if your time counts) is probably to start things like emacsserver from .ratpoisonrc to make sure they have the same environment as your rp session (e.g., that they run under your ssh-agent, etc.) and then shut them down when rp exits.

Jeff Abrahamson
+33 6 24 40 01 57
+44 7920 594 255    <-- only if I'm in the UK

http://jeff.purple.com/
http://blog.purple.com/jeff/


On 5 January 2015 at 23:38, Mike Fabre <address@hidden> wrote:
On January 6, 2015 12:49:05 AM AEDT, Dieter Van Eessen <address@hidden> 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.

_______________________________________________
Ratpoison-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/ratpoison-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]