-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc-linux-bash
executable file
·44 lines (39 loc) · 1.23 KB
/
.bashrc-linux-bash
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
#!/usr/bin/env bash
if [ -e /etc/bash.bashrc ] ; then
. /etc/bash.bashrc
fi
apt-get()
{
if test "$1" = source; then
command apt-get "$@";
else
command sudo apt-get "$@"
fi
}
. ~/system-config/bin/wp
function read-xauth() { # so that in the saved gnu screen session, I can reset the xauth
if test -z "$SSH_CLIENT"; then
if test "${BHJ_IN_VNC}" = true; then
. ~/.renew-xauth.${DISPLAY#:}
else
. ~/.renew-xauth
fi
. ~/system-config/bin/set-ssh-agent
elif test true = false; then
if test `ps -o comm= -o pid= -A|grep gnome-terminal|wc -l` != 1; then
echo 'you have more that 1 gnome-terminal running, can not renew xauth!'
return 1
fi
export $(cat /proc/`ps -o comm= -o pid= -A|grep gnome-terminal|pn 2`/environ|perl -npe 's/\x00/\n/g'|grep '^DISPLAY=')
export $(cat /proc/`ps -o comm= -o pid= -A|grep gnome-terminal|pn 2`/environ|perl -npe 's/\x00/\n/g'|grep '^REMOTEIP=')
fi
}
function sudo-x() {
(
unset PROMPT_COMMAND
exec sudo -E env PATH="$PATH" PERL5LIB="$PERL5LIB" "$@"
)
}
if test -e ~/.local-config/.bashrc-linux-bash; then
. ~/.local-config/.bashrc-linux-bash
fi