diff --git a/starttde b/starttde index 66360e228..512bff7d5 100755 --- a/starttde +++ b/starttde @@ -3,18 +3,6 @@ # DEFAULT TRINITY STARTUP SCRIPT # -# This block might not be appropriate for all systems. -# It should work for command line logins but graphical -# login managers might already source these files. -# Multiple sourcing is not a problem when the files are only -# containers for environment variables and such. -if [ -r /etc/xprofile ]; then - . /etc/xprofile -fi -if [ -r $HOME/.xprofile ]; then - . $HOME/.xprofile -fi - # Some functions to parse and check path correctly ... # Usage: is_in_path PATH /usr/bin is_in_path() { @@ -68,6 +56,31 @@ remove_from_path() { eval export $var=${NPATH#:} } +# Gentoo: In Gentoo $TDE_DIR/bin is in PATH by default, but it's located after /usr/bin, +# so to avoid running kf5 apps instead of TDE's one make sure it goes first + +TDE_BIN_DIR="$(dirname -- "$0")" +if ! is_before_in_path PATH "$TDE_BIN_DIR" "/usr/bin"; then + remove_from_path PATH "$TDE_BIN_DIR" + place_before_in_path PATH "$TDE_BIN_DIR" "/usr/bin" +fi +unset TDE_BIN_DIR + +# Gentoo: to avoid messing PATH that user might have set we moved .xprofile +# import here rather from the very begining of the script +# +# This block might not be appropriate for all systems. +# It should work for command line logins but graphical +# login managers might already source these files. +# Multiple sourcing is not a problem when the files are only +# containers for environment variables and such. +if [ -r /etc/xprofile ]; then + . /etc/xprofile +fi +if [ -r $HOME/.xprofile ]; then + . $HOME/.xprofile +fi + # Portable alternative to the file operator -nt (among shells) is_newer() { if test -n "$(find $1 -prune -newer $2 -print)" @@ -205,19 +218,21 @@ fi # Modify the following environment variables only as necessary. - if ! is_in_path PATH "$TDEDIR/games" ; then - # Respect the traditional path order. Don't blindly place $TDEDIR/games - # first in the path. Only place $TDEDIR/games before /usr/games. If packagers - # are adding $TDEDIR/games elsewhere, then they need to ensure the traditional - # search patch is respected. - # Is there a way we can check that $TDEDIR/games is always placed only just before - # /usr/games in the search path? - if is_in_path PATH "/usr/games"; then - place_before_in_path PATH "$TDEDIR/games" "/usr/games" - else - export PATH=$TDEDIR/games:$PATH - fi - fi +# Gentoo: there is no */games/bin directories in gentoo +# +# if ! is_in_path PATH "$TDEDIR/games" ; then +# # Respect the traditional path order. Don't blindly place $TDEDIR/games +# # first in the path. Only place $TDEDIR/games before /usr/games. If packagers +# # are adding $TDEDIR/games elsewhere, then they need to ensure the traditional +# # search patch is respected. +# # Is there a way we can check that $TDEDIR/games is always placed only just before +# # /usr/games in the search path? +# if is_in_path PATH "/usr/games"; then +# place_before_in_path PATH "$TDEDIR/games" "/usr/games" +# else +# export PATH=$TDEDIR/games:$PATH +# fi +# fi if ! is_in_path PATH "$TDEDIR/bin" ; then # Respect the traditional path order. Don't blindly place $TDEDIR/bin