XTRACE(1)
๐ XTRACE ๐
okay bestie, settle in, because xtrace is that girl. it's a lil program (a manual page in section 1, so it's a user command, iykyk) that traces communication between an X11 client and server. yes, like, wiretap but make it cute and for X11. โจ
๐ธ SYNOPSIS ๐ธ
xtrace [ options ] [ -s | -k ] [ [ -W ] [ -- ] command args ...
like, options first, then you pick -s or -k, then optionally -W, then optionally --, then whatever command you want it to run. simple as. ๐
๐ฆ DESCRIPTION ๐ฆ
So here's the whole vibe: xtrace fakes an X server and then forwards all connections to a real X server, showing you the communication between the clients in (and this is the original's own words, not mine) well, theoretically human readable form. it's giving translator but for X11 gossip. ๐
if you hand it a command, xtrace runs that named command with $DISPLAY set to the faked X server. slay. but heads up: if that command exits before any connections are made, xtrace exits immediately โ unless you passed -W. that's the whole rule, no cap. โจ
โจ OPTIONS โจ
-Idirectory โ look into directory for protocol description files. like, the directory where the.protofiles can be found. ๐-s,--stopwhendone(this one's the default) โ terminate when all forwarded clients have disconnected. (or, if a program was run, once the program has finished and all connections are closed.) ๐ค-k,--keeprunningโ if all clients disconnected, don't dip, just wait for new ones to connect. ๐-W,--waitforclientโ do not stop when the started program terminates before any connection was made. might be necessary if the program forks to background, fr fr. ๐ง-dname,--displayname โ forward connections to the X server specified by name instead of the one specified by the environment variableDISPLAY.-Dname,--fakedisplayname โ fake display name instead of$FAKEDISPLAYor:9respectively. ๐ญ-ffilename,--authfilefilename โ add an-f filenameto the arguments for all calls toxauthto get the authentication tokens of the X server to connect to.-Ffilename,--newauthfilefilename โ add an-f filenameto the arguments for all calls toxauthto save the authentication tokens to connect to the faked X server.-c,--copyauthentication(default, bestie, this is the default) โ copy the authentication tokens for the X server to connect to, so that clients connecting to our fake server will use them. ๐
the commands run are roughly equivalent to:
xauth add $FAKEDISPLAY . `xauth list $DISPLAY | awk '$2=="MIT-MAGIC-COOKIE-1" {print $3}'`
and not that only MIT-MAGIC-COOKIE-1 tokens are copied, because xtrace does not yet support changing the authentication tokens so that XDM-AUTHORIZATION-1 would be possible. so that's a limit, not a vibe. ๐ญ
-n,--nocopyauthenticationโ do not callxauthand do fiddle with authentication tokens, but leave that to the user to handle. you're on your own, main character. ๐-e,--denyextensionsโ modify all server replies to say there are no extensions available. (asxtracesupports only a small number of extensions anyway, and calls all extended requestsunknownand all replies to such requestsunexpected.) ๐-w,--readwritedebugโ print how many bytes are read and/or written, and when. ๐-mcount,--maxklistlengthcount โ print only the first count many elements of all lists.-i,--interactiveโ only send requests from the client to the server after interactive confirmation. confirmation is given by pressing enter, or a number followed by enter, via stdin. this can give funny results when multiple clients are tunneled. ๐-o,--outfilefilename โ dump output into filename instead of stdout. ๐-b,--bufferedโ do not write every line on its own, but wait until buffers are full. speeds up things a little bit when outputting to a file. not very useful at all together with-i. โก--timestampsโ print a timestamp before each line.
note that the time a packet is printed is between the time a packet is received and the time a packet is sent, but it gives no other information than that. โฐ
--relative-timestampsโ print a timestamp relative to the beginning of the connection before each line.
note that the time a packet is printed is between the time a packet is received and the time a packet is sent, but it gives no other information than that. โฑ๏ธ
--monotonic-timestampsโ print aCLOCK_MONOTONIC(seeclock_gettime(3)) timestamp each time a package is printed. this is likely to be the uptime of your system.
note that the time a packet is printed is between the time a packet is received and the time a packet is sent, but it gives no other information than that. ๐ฐ๏ธ
--print-offsetsโ print offsets of all fields (useful to debug nested lists in protocol descriptions). ๐ง--print-countsโ print counts (useful to debug lists in protocol descriptions). ๐ข
๐ ENVIRONMENT VARIABLES ๐
DISPLAYโ without--display, the content of this variable is used to determine the server to connect to. (and without-n, it's given toxauthto get the authentication tokens for this display.) ๐FAKEDISPLAYโ without--fakedisplay, the content of this variable is used to determine how to listen for clients. (and without-n, it's given toxauthto set the authentication tokens for this display.) if neither is given,xtracewill try:9. ๐XAUTHORITYโ without-nand without-for-F, yourxauthprogram will most likely look into this variable for the file to get/save the authentication tokens from/into. if this is not set, it will most likely use$HOME/.Xauthority. ๐๏ธ
๐ค REPORTING BUGS ๐ค
Report bugs to the Debian BTS. (that's it, that's the whole section, go off.) ๐ฎ
๐ซถ SEE ALSO ๐ซถ
xauth(1), x(7x)
๐ COPYRIGHT ๐
Copyright ยฉ 2005 Bernhard R. Link
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ๐จ
bestie reminder: no warranty, not even for merchantability or fitness for a particular purpose. that's not me being dramatic, that's literally the license. periodt. ๐
and that's the whole page, gorgeous โ this one's from the xtrace manual, dated 26 June 2009, section XTRACE(1). now go trace something. ๐ฆโจ๐
๐ฆ where this page comes from
- debian bookworm: xtrace 1.4.0-1+b1
- debian trixie: xtrace 1.4.0-1+b1
- nixos 26.05: xtrace 1.4.0
- nixpkgs unstable: xtrace 1.4.0
- ubuntu jammy: xtrace 1.4.0-1
- ubuntu noble: xtrace 1.4.0-1
- ubuntu questing: xtrace 1.4.0-1
- ubuntu resolute: xtrace 1.4.0-1build1
- ubuntu stonking: xtrace 1.4.0-1.1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms