-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
54 lines (50 loc) · 1.32 KB
/
.bashrc
File metadata and controls
54 lines (50 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# ~/.bashrc ejecutado por /usr/bin/bash
## Carga los alias
test -s ~/.alias && . ~/.alias || true
## Establece el prompt según la distribución.
if [ $(id -u) = 0 ]; then
PS1='\[\033[01;31m\]\$\[\033[00m\] '
else
case $(uname) in
Linux)
OS=$(grep ^"NAME" /etc/os-release)
case $OS in
*openSUSE*)
PS1='\[\033[01;32m\]\$\[\033[00m\] '
;;
*Ubuntu*)
PS1='\[\033[01;35m\]\$\[\033[00m\] '
;;
*Trisquel*)
PS1='\[\033[00;34m\]\$\[\033[00m\] '
;;
*Guix*)
PS1='\[\033[00;33m\]\$\[\033[00m\] '
;;
*)
PS1='\$ '
;;
esac
;;
OpenBSD)
PS1='\[\033[01;33m\]\$\[\033[00m\] '
;;
*)
PS1='\$ '
;;
esac
fi
## Ejecuta screen
# Actualizar el título de la ventana con el directorio actual en cada prompt (añade esto a tu ~/.bashrc o ~/.zshrc)
if [[ "$TERM" =~ "screen" ]]; then
PROMPT_COMMAND='echo -ne "\033k"${cmd%% *}"\033\\";echo -ne "\033k"$USER\@$HOSTNAME\:$PWD"\033\\"'
fi
\
if [ $(screen -ls | grep local | wc -l) -eq 0 ]; then
screen -dmS local
fi
## Abre la sesión de screen solo si no es tty.
## El condicional es para que permite iniciar X.
if tty | grep pts > /dev/null; then
screen -x local
fi