Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add identifying client info to 'xpra list' output #4082

Closed
karlkleinpaste opened this issue Dec 21, 2023 · 5 comments
Closed

add identifying client info to 'xpra list' output #4082

karlkleinpaste opened this issue Dec 21, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@karlkleinpaste
Copy link

Is your feature request related to a problem? Please describe.
The output of xpra list doesn't tell me anything useful about clients, merely that they exist.

Describe the solution you'd like
In this output...

$ xpra list
Found the following xpra sessions:
/home/karl/.xpra:
	LIVE session at :27
	LIVE session at :73
/run/user/5271/xpra/clients:
	LIVE session at :1439094
	LIVE session at :1446093
	LIVE session at :196224
	LIVE session at :199091
	LIVE session at :199093
	LIVE session at :199098
	LIVE session at :2419503
	LIVE session at :2419627

... it would be helpful if the clients would include some part of the client info, such as :86 or ssh://remote/XX.

Otherwise I must ps wu 1439094 just to learn what that client is about.

@karlkleinpaste karlkleinpaste added the enhancement New feature or request label Dec 21, 2023
totaam added a commit that referenced this issue Dec 25, 2023
@totaam
Copy link
Collaborator

totaam commented Dec 25, 2023

You could just run:

xpra info :1439094

And as of 61d2004, just look for endpoint.

I would rather not make xpra list slower than it already is.

@karlkleinpaste
Copy link
Author

Well...OK. I would have preferred a builtin bit. As it is, I've just written a script xplist:

#!/bin/bash
xpra list 2>&1 |
(
    while read l ; do
	if [[ ! "$l" =~ xpra/clients: ]] ; then
	    [[ "$l" =~ LIVE ]] && l="	$l"
	    echo "$l"
	else
	    echo "$l"
	    break
	fi
    done
    while read l ; do
	if [[ ! "$l" =~ LIVE ]] ; then
	    echo "	$l"
	else
	    p="`echo $l | cut -d' ' -f4`"
	    endp="`xpra info $p | grep endpoint | sed 's/endpoint=//'`"
	    echo "	$l	$endp"
	fi
    done
)

Result:

$ xplist
Found the following xpra sessions:
/home/karl/.xpra:
	LIVE session at :28
	LIVE session at :73
/run/user/5271/xpra/clients:
	LIVE session at :17050	:28
	LIVE session at :18005	:73
	LIVE session at :21541	chqkkleinpa1:22
	LIVE session at :21542	cdcvdr9ebu01:22
	LIVE session at :428093	ph:7887
	LIVE session at :430062	godiva:7887
	LIVE session at :433233	micro:7887
	LIVE session at :440572	minor:7887

I could have done the endp calculation with ps $p | tail -1 | sed -e 's/.*attach //' -e 's/ .*//' but the endpoint thing is as good, I suppose.

@karlkleinpaste
Copy link
Author

Belated observation...

The xpra info $p version doesn't include the $DISPLAY in use at the client. So I've gone to the alternate using ps:

endp="`ps ${p#:} | tail -1 | sed -e 's/.*attach //' -e 's/ .*//'`"

[ Just leaving crumbs behind for anyone else who might ask similar questions. ]

totaam added a commit that referenced this issue Dec 28, 2023
@totaam
Copy link
Collaborator

totaam commented Dec 28, 2023

As of the commit below, you can also do:

$ xpra info :15716 | egrep "session-type|display"
session-type=Wayland client
display=wayland-0

Not tested with MS Windows and MacOS clients, but these should also be showing things like MacOS client.

totaam added a commit that referenced this issue Dec 28, 2023
totaam added a commit that referenced this issue Dec 28, 2023
@totaam
Copy link
Collaborator

totaam commented Dec 28, 2023

@karlkleinpaste how about dc9882f:

$ xpra list-clients
Found the following 1 xpra client sessions:
/run/user/1000/xpra/clients/fedora-27154:
	LIVE Wayland client on 'wayland-0' connected to 'tcp://127.0.0.1:10000/'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants