Scindix

/etc/environment /etc/profile /etc/bash.bashrc

Nov 29th, 2025
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. # /etc/environment
  2. #
  3. # This file is parsed by pam_env module
  4. #
  5. # Syntax: simple "KEY=VAL" pairs on separate lines
  6. #
  7. GTK_IM_MODULE=ibus
  8. QT_IM_MODULE=ibus
  9. XMODIFIERS=@im=ibus
  10.  
  11.  
  12. # /etc/profile
  13.  
  14. # Append "$1" to $PATH when not already in.
  15. # This function API is accessible to scripts in /etc/profile.d
  16. append_path () {
  17. case ":$PATH:" in
  18. *:"$1":*)
  19. ;;
  20. *)
  21. PATH="${PATH:+$PATH:}$1"
  22. esac
  23. }
  24.  
  25. # Append our default paths
  26. append_path '/usr/local/sbin'
  27. append_path '/usr/local/bin'
  28. append_path '/usr/bin'
  29.  
  30. # Force PATH to be environment
  31. export PATH
  32.  
  33. #
  34. # Load profiles from /etc/profile.d
  35. if test -d /etc/profile.d/; then
  36. for profile in /etc/profile.d/*.sh; do
  37. test -r "$profile" && . "$profile"
  38. done
  39. unset profile
  40. fi
  41.  
  42. # unset GLOBSORT, before anything else is sourced
  43. # This variable will be part of bash => 5.3
  44. # The rationale is that the user should always be able
  45. # to expect that the snippets be processed in a deterministic order.
  46. unset -v GLOBSORT
  47.  
  48. # Unload our profile API functions
  49. unset -f append_path
  50.  
  51. # Source global bash config, when interactive but not posix or sh mode
  52. if test "$BASH" &&\
  53. test "$PS1" &&\
  54. test -z "$POSIXLY_CORRECT" &&\
  55. test "${0#-}" != sh &&\
  56. test -r /etc/bash.bashrc
  57. then
  58. . /etc/bash.bashrc
  59. fi
  60.  
  61. # Termcap is outdated, old, and crusty, kill it.
  62. unset TERMCAP
  63.  
  64. # Man is much better than us at figuring this out
  65. unset MANPATH
  66.  
  67.  
  68. #
  69. # /etc/bash.bashrc
  70. #
  71.  
  72. # If not running interactively, don't do anything
  73. [[ $- != *i* ]] && return
  74.  
  75. # Prevent doublesourcing
  76. if [[ -z "${BASHRCSOURCED}" ]] ; then
  77. BASHRCSOURCED="Y"
  78. # the check is bash's default value
  79. [[ "$PS1" = '\s-\v\$ ' ]] && PS1='[\u@\h \W]\$ '
  80. case ${TERM} in
  81. Eterm*|alacritty*|aterm*|foot*|gnome*|konsole*|kterm*|putty*|rxvt*|tmux*|xterm*)
  82. PROMPT_COMMAND+=('printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"')
  83. ;;
  84. screen*)
  85. PROMPT_COMMAND+=('printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"')
  86. ;;
  87. esac
  88. fi
  89.  
  90. if [[ -r /usr/share/bash-completion/bash_completion ]]; then
  91. . /usr/share/bash-completion/bash_completion
  92. fi
  93.  
Advertisement
Add Comment
Please, Sign In to add comment