Replace bare $var with ${var} everywhere it was still used, matching
the convention already established in rc.d/prompt and rc.d/history.
Positional parameters ($1, $@, $#) and special variables ($?, $$, $-)
are left as-is, consistent with existing usage in _helpers.bash.
rc.d/broot is auto-generated by the broot binary and will likely be
overwritten with its original formatting on the next broot update.
27 lines
624 B
Plaintext
27 lines
624 B
Plaintext
# Auto startx depending on the VT
|
|
|
|
if [[ -z "${DISPLAY}" && $(id -u) -ge 1000 ]] ; then
|
|
|
|
TTY=$(tty)
|
|
if [ "${TTY}" == "not a tty" ]; then return; fi
|
|
if [ "${TTY/tty}" != "${TTY}" -a "$(basename "${TTY/tty}")" -le 3 ]
|
|
then
|
|
|
|
case $(tty | cut -b9-) in
|
|
1) VT=vt1 ;;
|
|
2) VT=vt2 ;;
|
|
3) VT=vt3 ;;
|
|
esac
|
|
|
|
if ( which ck-launch-session &> /dev/null )
|
|
then
|
|
EXEC="exec ck-launch-session"
|
|
fi
|
|
|
|
if ( which startx &> /dev/null )
|
|
then
|
|
${EXEC} startx 1> ~/.log/xsession-errors 2>&1 -- "${VT}"
|
|
fi
|
|
fi
|
|
fi
|