wsetup.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/sh
  2. # wayland-session - run as user
  3. # Copyright (C) 2015-2016 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
  4. # This file is extracted from kde-workspace (kdm/kfrontend/genkdmconf.c)
  5. # Copyright (C) 2001-2005 Oswald Buddenhagen <ossi@kde.org>
  6. # Note that the respective logout scripts are not sourced.
  7. case $SHELL in
  8. */bash)
  9. [ -z "$BASH" ] && exec $SHELL $0 "$@"
  10. set +o posix
  11. [ -f /etc/profile ] && . /etc/profile
  12. if [ -f $HOME/.bash_profile ]; then
  13. . $HOME/.bash_profile
  14. elif [ -f $HOME/.bash_login ]; then
  15. . $HOME/.bash_login
  16. elif [ -f $HOME/.profile ]; then
  17. . $HOME/.profile
  18. fi
  19. source /usr/milis/bin/desktop.sh
  20. ;;
  21. */zsh)
  22. [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@"
  23. [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc
  24. zhome=${ZDOTDIR:-$HOME}
  25. # zshenv is always sourced automatically.
  26. [ -f $zdir/zprofile ] && . $zdir/zprofile
  27. [ -f $zhome/.zprofile ] && . $zhome/.zprofile
  28. [ -f $zdir/zlogin ] && . $zdir/zlogin
  29. [ -f $zhome/.zlogin ] && . $zhome/.zlogin
  30. emulate -R sh
  31. ;;
  32. */csh|*/tcsh)
  33. # [t]cshrc is always sourced automatically.
  34. # Note that sourcing csh.login after .cshrc is non-standard.
  35. wlsess_tmp=`mktemp /tmp/wlsess-env-XXXXXX`
  36. $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c 'export -p' >! $wlsess_tmp"
  37. . $wlsess_tmp
  38. rm -f $wlsess_tmp
  39. ;;
  40. */fish)
  41. [ -f /etc/profile ] && . /etc/profile
  42. xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX`
  43. $SHELL --login -c "/bin/sh -c 'export -p' > $xsess_tmp"
  44. . $xsess_tmp
  45. rm -f $xsess_tmp
  46. ;;
  47. *) # Plain sh, ksh, and anything we do not know.
  48. [ -f /etc/profile ] && . /etc/profile
  49. [ -f $HOME/.profile ] && . $HOME/.profile
  50. ;;
  51. esac
  52. exec dbus-run-session $@