initial import
This commit is contained in:
commit
2898289fe0
9
05-ssh-detect/profile
Normal file
9
05-ssh-detect/profile
Normal file
@ -0,0 +1,9 @@
|
||||
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||
SESSION_TYPE=remote/ssh
|
||||
else
|
||||
case $(ps -o comm= -p $PPID) in
|
||||
sshd|*/sshd) SESSION_TYPE=remote/ssh;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# vim: set syntax=bash:
|
10
30-ssh-agent/profile
Normal file
10
30-ssh-agent/profile
Normal file
@ -0,0 +1,10 @@
|
||||
if [ -f ~/.agent.env ] ; then
|
||||
. ~/.agent.env > /dev/null
|
||||
if ! kill -0 $SSH_AGENT_PID > /dev/null 2>&1; then
|
||||
#echo "Stale agent file found. Spawning new agent… "
|
||||
eval `ssh-agent | tee ~/.agent.env` >/dev/null
|
||||
fi
|
||||
else
|
||||
#echo "Starting ssh-agent"
|
||||
eval `ssh-agent | tee ~/.agent.env` >/dev/null
|
||||
fi
|
5
90-history/profile
Normal file
5
90-history/profile
Normal file
@ -0,0 +1,5 @@
|
||||
export HISTSIZE=-1
|
||||
export HISTFILESIZE=-1
|
||||
export HISTCONTROL=ignorespace
|
||||
export HISTIGNORE="$HISTIGNORE:rm *"
|
||||
|
46
91-tick/profile
Normal file
46
91-tick/profile
Normal file
@ -0,0 +1,46 @@
|
||||
function fg_color
|
||||
{
|
||||
if [ -n "$1" ]; then
|
||||
echo -n "\\[\\033[01;${1}m\\]"
|
||||
else
|
||||
echo -n "\\[\\033[00m\\]"
|
||||
fi
|
||||
}
|
||||
|
||||
RED=$(fg_color 31)
|
||||
GREEN=$(fg_color 32)
|
||||
YELLOW=$(fg_color 33)
|
||||
BLUE=$(fg_color 34)
|
||||
RESET=$(fg_color)
|
||||
|
||||
case "${SESSION_TYPE}" in
|
||||
remote\/*) PROMPT_COLOUR=${YELLOW};;
|
||||
*) PROMPT_COLOUR=${GREEN};;
|
||||
esac
|
||||
|
||||
function prompt_command {
|
||||
res=$?
|
||||
|
||||
PS1=""
|
||||
|
||||
if [ -n "$VIRTUAL_ENV" ]; then
|
||||
PS1="($(basename $VIRTUAL_ENV)) "
|
||||
fi
|
||||
|
||||
PS1="${PS1}$(fg_color 32)${USER:-$(whoami 2>/dev/null)}"
|
||||
PS1="${PS1}@"
|
||||
PS1="${PS1}${PROMPT_COLOUR}$(uname -n 2>/dev/null) \$ "
|
||||
PS1="${PS1}$(fg_color 34)"
|
||||
|
||||
if [ $res == "0" ]; then
|
||||
PS1="$PS1✓ "
|
||||
else
|
||||
PS1="$PS1✗ "
|
||||
fi
|
||||
|
||||
PS1="$PS1\w \$\[\033[00m\] "
|
||||
PS1="${PS1}$(fg_color)"
|
||||
}
|
||||
|
||||
|
||||
export PROMPT_COMMAND=prompt_command
|
8
bash_profile.sh
Executable file
8
bash_profile.sh
Executable file
@ -0,0 +1,8 @@
|
||||
SELF="$(realpath "${BASH_SOURCE[0]}")"
|
||||
DIR="$(cd "$(dirname "${SELF}")"; pwd -P)"
|
||||
|
||||
source "${DIR}/bashrc.sh"
|
||||
|
||||
for d in $(ls "${DIR}"/*/profile); do
|
||||
source "${d}"
|
||||
done
|
18
bashrc.sh
Executable file
18
bashrc.sh
Executable file
@ -0,0 +1,18 @@
|
||||
# /etc/skel/.bashrc
|
||||
#
|
||||
# This file is sourced by all *interactive* bash shells on startup,
|
||||
# including some apparently interactive shells such as scp and rcp
|
||||
# that can't tolerate any output. So make sure this doesn't display
|
||||
# anything or bad things will happen !
|
||||
|
||||
|
||||
# Test for an interactive shell. There is no need to set anything
|
||||
# past this point for scp and rcp, and it's important to refrain from
|
||||
# outputting anything in those cases.
|
||||
if [[ $- != *i* ]] ; then
|
||||
# Shell is non-interactive. Be done now!
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
# Put your fun stuff here.
|
7
install.sh
Executable file
7
install.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
SELF="$(realpath "${BASH_SOURCE[0]}")"
|
||||
DIR="$(cd "$(dirname "${SELF}")"; pwd -P)"
|
||||
|
||||
ln -s "${DIR}/bash_profile.sh" ~/.bash_profile
|
||||
ln -s "${DIR}/bashrc.sh" ~/.bashrc
|
Loading…
Reference in New Issue
Block a user