slitaz-base-files view rootfs/etc/profile @ rev 338
Update /etc/profile
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jan 14 10:21:20 2019 +0100 (2019-01-14) |
parents | 9e80adfca421 |
children | 3b8ba0fadc4f |
line source
1 # /etc/profile: System-wide .profile file for the Bourne shells
3 PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/sbin:/usr/local/bin"
4 LD_LIBRARY_PATH="/usr/lib:/lib:/usr/local/lib"
6 # Prompt format for Ash (Bash use /etc/bashrc).
7 if [ $(id -u) -eq 0 ]; then
8 # Red and blue for root
9 PS1="\[\e[1;31m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\\$ "
10 #PS1='\u@\h:\w\$ '
11 else
12 # Green and blue for users
13 PS1="\[\e[1;32m\]\u@\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\\$ "
14 #PS1='\u@\h:\w\$ '
15 fi
17 # Max 64M for programs (prevent memory leak crashes)
18 #
19 # ulimit -d 65536 # commented out because lzma requires at least 94 MB of RAM to compress files.
20 ulimit -m 65536
22 # Screen display for X and encoding for GTK+ apps
23 #
24 [ -n "$DISPLAY" ] || DISPLAY=:0.0
25 G_FILENAME_ENCODING=UTF-8
27 # Make OpenOffice look better
28 #
29 OOO_FORCE_DESKTOP=gnome
31 # Export all variables defined above and set mask
32 #
33 export PATH LD_LIBRARY_PATH PS1 DISPLAY G_FILENAME_ENCODING
34 export OOO_FORCE_DESKTOP ignoreeof
35 umask 022
37 # Locale and timezone settings
38 #
39 if [ -s "/etc/locale.conf" ]; then
40 . /etc/locale.conf
41 export LANG LC_ALL
42 fi
43 if [ -s "/etc/TZ" ]; then
44 TZ=$(cat /etc/TZ)
45 export TZ
46 fi
48 # Update X Terminal window title
49 #
50 ip=$(ifconfig $(route -n 2>/dev/null | sed '/^0\.0\.0\.0/!d;s/.* //') 2>/dev/null | sed '/t a/!d;s/.*r:\([^ ]*\).*/\1/')
51 case "$TERM" in
52 xterm*|rxvt*) echo -ne "\033]0;$(hostname) $(cat /etc/slitaz-release) $ip \007";;
53 esac
56 # User preferred applications
58 [ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME="$HOME/.config"
59 if [ -s "$XDG_CONFIG_HOME/slitaz/applications.conf" ]; then
60 . "$XDG_CONFIG_HOME/slitaz/applications.conf"
61 elif [ -s '/etc/slitaz/applications.conf' ]; then
62 . '/etc/slitaz/applications.conf'
63 fi
64 export FILE_MANAGER BROWSER EDITOR TERMINAL WINDOW_MANAGER
67 # Bash compatibility
69 dirs() {
70 echo $_dirs
71 }
73 pushd() {
74 cd $1 && _dirs="$1 $_dirs" && dirs
75 }
77 popd() {
78 [ -n "$_dirs" ] && _dirs="${_dirs#* }" && cd ${_dirs%% *} && dirs
79 }
81 command_not_found_handle() {
82 [ -x /bin/command_not_found ] && /bin/command_not_found "$@" ||
83 echo "$SHELL: $1: not found"
84 }