xsession fixes
This commit is contained in:
parent
6d37ad418f
commit
01773469be
1 changed files with 4 additions and 2 deletions
|
@ -8,7 +8,9 @@ OPTIONFILE=/etc/X11/Xsession.options
|
|||
|
||||
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/X11/xresources" ] && USRRESOURCES=${XDG_CONFIG_HOME:-$HOME/.config}/X11/xresources || USRRESOURCES=$HOME/.Xresources
|
||||
[ -r "${XDG_CONFIG_HOME:-$HOME/.config}/X11/xsession.d" ] && SESSIONDIR=${XDG_CONFIG_HOME:-$HOME/.config}/X11/xsession.d || SESSIONDIR=/etc/X11/Xsession.d
|
||||
[ -d "${XDG_DATA_HOME:-$HOME/.local/share}/xorg/" ] && ERRFILE=${XDG_DATA_HOME:-$HOME/.local/share}/xorg/xsession-errors || ERRFILE=$HOME/.xsession-errors
|
||||
[ -r "${XDG_DATA_HOME:-$HOME/.local/share}/xorg/xsession-errors" ] &&
|
||||
ERRFILE=${XDG_DATA_HOME:-$HOME/.local/share}/xorg/xsession-errors ||
|
||||
ERRFILE=$HOME/.xsession-errors && touch $ERRFILE
|
||||
|
||||
message() {
|
||||
# pretty-print messages of arbitrary length; use xmessage if it
|
||||
|
@ -80,7 +82,7 @@ else
|
|||
fi
|
||||
|
||||
# truncate ERRFILE if it is too big to avoid disk usage DoS
|
||||
if [ "$(stat -c%s \""$ERRFILE"\")" -gt 500000 ]; then
|
||||
if [ "$(stat -c%s "$ERRFILE")" -gt 500000 ]; then
|
||||
T=$(mktemp -p "$HOME")
|
||||
tail -c 500000 "$ERRFILE" >"$T" && mv -f "$T" "$ERRFILE" || rm -f "$T"
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue