02_runasroot.zsh 392 B

12345678910111213
  1. #
  2. # Use the user zsh configuration as root
  3. #
  4. if [[ -n "${SUDO_USER}" ]] && [[ "${UID}" = 0 ]]; then
  5. # define root history path
  6. export HISTFILE="${ZSHDOTDIR}/history/history_root"
  7. if [[ -f ~/.zcompdump ]]; then
  8. # ugly hack : reset some file perms to normal to avoid warnings
  9. chmod 0644 ~/.zcompdump
  10. chown "${SUDO_USER}:${SUDO_USER}" ~/.zcompdump
  11. fi
  12. fi