summaryrefslogtreecommitdiff
path: root/startx.cpp
diff options
context:
space:
mode:
authorTim Egenton <tegenton@splattim.me>2021-12-07 09:15:18 -0500
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-10-24 22:55:02 +0000
commit4e66c0bf2b5751e113ad3aba79891608f7e883e2 (patch)
tree4550f9aba2767fbabf56b0be6da05325485912bc /startx.cpp
parent0ea1ec1ed445235cdba9e54e71023d5a82feed6b (diff)
startx: Source XINITRC and XSERVERRC variables
Fix issue #14 Check XINITRC and XSERVERRC, if those files do not exist then just use ~/.xinitrc and ~/.xserverc as normal. Signed-off-by: Tim Egenton <tegenton@splattim.me>
Diffstat (limited to 'startx.cpp')
-rw-r--r--startx.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/startx.cpp b/startx.cpp
index 7ed38db..dfbebe1 100644
--- a/startx.cpp
+++ b/startx.cpp
@@ -2,11 +2,12 @@ XCOMM!SHELL_CMD
XCOMM
XCOMM This is just a sample implementation of a slightly less primitive
-XCOMM interface than xinit. It looks for user .xinitrc and .xserverrc
-XCOMM files, then system xinitrc and xserverrc files, else lets xinit choose
-XCOMM its default. The system xinitrc should probably do things like check
-XCOMM for .Xresources files and merge them in, start up a window manager,
-XCOMM and pop a clock and several xterms.
+XCOMM interface than xinit. It looks for XINITRC and XSERVERRC environment
+XCOMM variables, then user .xinitrc and .xserverrc files, and then system
+XCOMM xinitrc and xserverrc files, else lets xinit choose its default.
+XCOMM The system xinitrc should probably do things like check for
+XCOMM .Xresources files and merge them in, start up a window manager, and
+XCOMM pop a clock and several xterms.
XCOMM
XCOMM Site administrators are STRONGLY urged to write nicer versions.
XCOMM
@@ -47,9 +48,11 @@ export PATH
#endif
userclientrc=$HOME/.xinitrc
+[ -f "${XINITRC}" ] && userclientrc="${XINITRC}"
sysclientrc=XINITDIR/xinitrc
userserverrc=$HOME/.xserverrc
+[ -f "${XSERVERRC}" ] && userclientrc="${XSERVERRC}"
sysserverrc=XINITDIR/xserverrc
defaultclient=XTERM
defaultserver=XSERVER