sx: use the default logfile

There's not a lot of point in absorbing the xserver's log file when it
will just be less intuitive for those looking for it in the standard
location.  Since the log is generated by Xorg and not sx, it only seems
reasonable.

This commit also renames xauthfile to xauthority for a little more
consistency with documentation and prior art.
This commit is contained in:
Earnestly 2017-12-02 02:22:29 +00:00
parent 29e20b2e41
commit e08bc130c0
3 changed files with 12 additions and 27 deletions

13
README
View File

@ -14,31 +14,18 @@ INTRODUCTION
* The Xorg server's command-line is hard coded and not exposed to the * The Xorg server's command-line is hard coded and not exposed to the
user. user.
* The first DISPLAY is 1 instead of 0 contrary to what X(7) suggests. * The first DISPLAY is 1 instead of 0 contrary to what X(7) suggests.
* xauth entries are overwritten if the displayname is identical. * xauth entries are overwritten if the displayname is identical.
* Corresponding xauth entries are unconditionally removed when the Xorg * Corresponding xauth entries are unconditionally removed when the Xorg
server is terminated. server is terminated.
* The Xorg server uses the -noreset flag. * The Xorg server uses the -noreset flag.
* /usr/lib/xorg-server/Xorg is used directly, bypassing Xorg.wrap. * /usr/lib/xorg-server/Xorg is used directly, bypassing Xorg.wrap.
* The Xorg server logs are written to $XDG_DATA_HOME/sx/$DISPLAY instead
of Xorg.$DISPLAY.log
* While XAUTHORITY is still honoured, $XDG_CONFIG_HOME/sx/xauthfile is * While XAUTHORITY is still honoured, $XDG_CONFIG_HOME/sx/xauthfile is
used instead of $HOME/.Xauthority used instead of $HOME/.Xauthority
* Very little proxy error checking is used preferring instead to let each * Very little proxy error checking is used preferring instead to let each
tool speak for itself. tool speak for itself.
* None of the typical /etc/X11/xinit infrastructure is directly used. * None of the typical /etc/X11/xinit infrastructure is directly used.
* Neither XINITRC is honoured nor .xinitrc used. * Neither XINITRC is honoured nor .xinitrc used.
* The XDG_CONFIG_HOME/sx/sxrc file is used instead of .xinitrc and is * The XDG_CONFIG_HOME/sx/sxrc file is used instead of .xinitrc and is
required to be executable. required to be executable.

8
sx
View File

@ -44,10 +44,9 @@ case $tty in
esac esac
cfgdir=${XDG_CONFIG_HOME:-$HOME/.config}/sx cfgdir=${XDG_CONFIG_HOME:-$HOME/.config}/sx
datadir=${XDG_DATA_HOME:-$HOME/.local/share}/sx XAUTHORITY=${XAUTHORITY:-$cfgdir/xauthority}
XAUTHORITY=${XAUTHORITY:-$cfgdir/xauthfile}
mkdir -p "$cfgdir" "$datadir" mkdir -p "$cfgdir"
touch "$XAUTHORITY" touch "$XAUTHORITY"
export XAUTHORITY export XAUTHORITY
@ -65,8 +64,7 @@ xauth add :"$tty" MIT-MAGIC-COOKIE-1 "$(mcookie)"
trap 'DISPLAY=:$tty "${@:-"$cfgdir"/sxrc}"' USR1 trap 'DISPLAY=:$tty "${@:-"$cfgdir"/sxrc}"' USR1
( (
trap '' USR1 trap '' USR1
exec /usr/lib/xorg-server/Xorg :"$tty" -keeptty vt"$tty" -noreset \ exec /usr/lib/xorg-server/Xorg :"$tty" -keeptty vt"$tty" -noreset -auth "$XAUTHORITY"
-logfile "$datadir/$tty" -auth "$XAUTHORITY"
) & pid=$! ) & pid=$!
wait wait

18
sx.1
View File

@ -24,13 +24,13 @@ argument is provided.
.SH ENVIRONMENT .SH ENVIRONMENT
.TP .TP
.B XAUTHORITY .B XAUTHORITY
This environment represents the file used to store authorisation entries used This environment is the path to a file which to stores authorisation entries
to secure used to secure
.BR Xorg (1) . .BR Xorg (1) .
If this environment is not set then If this environment is not set then
.B sx .B sx
will create and use will create and use
.IR \%$XDG_CONFIG_HOME/sx/xauthfile .IR \%$XDG_CONFIG_HOME/sx/xauthority
instead. instead.
.SH FILES .SH FILES
@ -40,18 +40,18 @@ The default client started by
.BR sx . .BR sx .
This file must be executable. This file must be executable.
.TP .TP
.BR $XDG_DATA_HOME/sx " " "" ( $HOME/.local/share/sx ) .BR $XDG_CONFIG_HOME/sx/xauthority " " "" ( $HOME/.config/sx/xauthority )
This directory is used for storing the logs generated by The default authority used by
.BR Xorg (1) . .B sx
Each log is named numerically based on the if an alternative file is not provided with
.B DISPLAY .BR $XAUTHORITY .
environment.
.SH SOURCE .SH SOURCE
.UR https://github.com/Earnestly/sx .UR https://github.com/Earnestly/sx
.UE .UE
.SH SEE ALSO .SH SEE ALSO
.BR xauth (1),
.BR xinit (1), .BR xinit (1),
.BR startx (1), .BR startx (1),
.BR Xserver (1), .BR Xserver (1),