Re: Denoting Remote Machines (Re: Custom Icons for GNOME Terminal Profiles)



On 11/19/05, Davyd Madeley <davyd madeley id au> wrote:
> On Sat, 2005-11-19 at 03:11 -0500, Havoc Pennington wrote:
> > On Sat, 2005-11-19 at 14:16 +0800, Davyd Madeley wrote:
> > > A feature like this might be interesting in Metacity. Same as
> > > Nautilus says "documents on floyd" it would be cool if Metacity
> > > could say "MGiva on charlie17". This would be particularly useful
> > > when you're running the same application on multiple cluster heads.
> >
> > On an LTSP setup it'd look awful though... and for terminals it's kind
> > of misleading (don't most people set the host they are ssh'd to in the
> > titlebar via bash, not the host the terminal is running on...)
>
> If you're X forwarding an entire session then it wouldn't make a lot of
> sense. I would suggest that it would only be shown if the name of the
> client is different to the name of the machine that Metacity is running
> on (which is often the same machine as the Xserver, it may not be on
> some LTSP and X-terminal setups).

Well, that would definitely mean no change for normal desktop setups
(i.e. everything-runs-locally) and I'm guessing it would also mean no
change for LTSP setups; both of which are good things.  It would seem
to make sense for the mix-and-match case (that I occasionally run
too), so it may be worth trying.

> The idea is not to tell someone where they are logged in to, but what
> machine their remote X window is running on. So if you're running xterm
> on charlie2 but logged into charlie17 you would see "XTerm:
> davyd charlie17:~ (on charlie2)".

Though that would seem fairly unusual, to me at least.  Most people
would probably run the xterm from the machine they are logged into and
then ssh into the machine they want to get to--and by your suggestion,
that case wouldn't cause the title of the terminal to be any different
than it is now, which I think is good.

> Something to consider is how we find out the hostname of the X-client if
> they're X-forwarding of ssh.

Via the WM_CLIENT_MACHINE property (which is stored in Metacity, not
too surprisingly, as the wm_client_machine field in the MetaWindow
struct if you want to take a look at the code).  This property in
combination with the _NET_WM_PID property is currently used in order
for the WM to offer the user the opportunity to kill unresponsive
windows.

If you want to try to code this up, take a look at
metacity/src/delete.c:meta_window_kill() for detecting windows which
run on the same host as metacity, and at
metacity/src/window-props.c:set_window_title() for how to modify the
window title (you may also want to look at set_icon_title() in the
same function if you want the title when iconified to be modified in
the same way).

You can find descriptions of WM_CLIENT_MACHINE (which is actually an
ICCCM property), _NET_WM_PID, _NET_WM_VISIBLE_NAME, and other EWMH
properties at http://standards.freedesktop.org/wm-spec/wm-spec-1.4.html.

Anyway, feel free to have a shot at it if you like.  It seems to me
like it'd probably make sense, but Havoc would be the one that you
need to convince whether this feature is going to be 'right' or not. 
Either way, it might be a fun little coding exercise.

Cheers,
Elijah



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