mirror of
https://github.com/nikdoof/dotfiles.git
synced 2025-12-13 17:52:26 +00:00
Few bash changes
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# Git pulls latest dotfiles
|
# Git pulls latest dotfiles
|
||||||
function update-dotfiles() {
|
function update-dotfiles() {
|
||||||
prevdir=$PWD
|
prevdir=$PWD
|
||||||
@@ -14,15 +13,15 @@ function update-dotfiles() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function add-sshkey() {
|
function add-sshkey() {
|
||||||
TIMEOUT="1h"
|
TIMEOUT="2h"
|
||||||
NAME=$1
|
NAME=$1
|
||||||
|
|
||||||
if [ -z "$NAME" ]; then
|
if [ -z "$NAME" ]; then
|
||||||
echo "Current Keys"
|
echo "Current Keys"
|
||||||
ssh-add -L
|
ssh-add -L
|
||||||
else
|
else
|
||||||
if [ -f "$HOME/.ssh/id_ed25519_${NAME}" ]; then
|
if [ -f "${HOME}/.ssh/id_ed25519_${NAME}" ]; then
|
||||||
ssh-add -t $TIMEOUT "$HOME/.ssh/id_ed25519_${NAME}"
|
ssh-add -t $TIMEOUT "${HOME}/.ssh/id_ed25519_${NAME}"
|
||||||
else
|
else
|
||||||
echo "No key named ${NAME} found..."
|
echo "No key named ${NAME} found..."
|
||||||
fi
|
fi
|
||||||
@@ -39,4 +38,4 @@ function demoprompt() {
|
|||||||
PS1="\$ "
|
PS1="\$ "
|
||||||
clear
|
clear
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,19 +8,32 @@ fi
|
|||||||
# User specific environment and startup programs
|
# User specific environment and startup programs
|
||||||
export TZ=GB
|
export TZ=GB
|
||||||
export LANG=en_GB.UTF-8
|
export LANG=en_GB.UTF-8
|
||||||
export EDITOR=nano
|
|
||||||
export VISUAL=nano
|
if [ -x /usr/bin/nano ]; then
|
||||||
|
export EDITOR=nano
|
||||||
|
export VISUAL=nano
|
||||||
|
else
|
||||||
|
export EDITOR=vi
|
||||||
|
export VISUAL=vi
|
||||||
|
fi
|
||||||
|
|
||||||
# OSX Specific envs
|
# OSX Specific envs
|
||||||
if [ $(uname) == "Darwin" ]; then
|
if [ $(uname) == "Darwin" ]; then
|
||||||
# Shhh Catlina, we don't care!
|
# Shhh Catlina, we don't care!
|
||||||
export BASH_SILENCE_DEPRECATION_WARNING=1
|
export BASH_SILENCE_DEPRECATION_WARNING=1
|
||||||
|
|
||||||
# M1 specific hacks
|
# M1 specific hacks
|
||||||
if [ $(uname -p) == "arm" ]; then
|
if [ $(uname -p) == "arm" ]; then
|
||||||
# Stop golang progs having fun with Rosetta 2 (https://yaleman.org/post/2021/2021-01-01-apple-m1-terraform-and-golang/)
|
# Stop golang progs having fun with Rosetta 2 (https://yaleman.org/post/2021/2021-01-01-apple-m1-terraform-and-golang/)
|
||||||
export GODEBUG=asyncpreemptoff=1
|
export GODEBUG=asyncpreemptoff=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Go stuff
|
||||||
|
if [ -d /usr/local/go ]; then
|
||||||
|
export GOROOT=/usr/local/go/
|
||||||
|
export GOPATH=$HOME/go/
|
||||||
|
export PATH=$PATH:/usr/local/go/bin
|
||||||
|
fi
|
||||||
|
|
||||||
export PS1="\[\e[0;90m\][\[\e[0;37m\]\u\[\e[0;37m\]@\[\e[0;37m\]\H\[\e[0;90m\]] \[\e[0;90m\](\[\e[0;37m\]\W\[\e[0;90m\]) \[\e[0;37m\]\$\[\e[0m\] "
|
export PS1="\[\e[0;90m\][\[\e[0;37m\]\u\[\e[0;37m\]@\[\e[0;37m\]\H\[\e[0;90m\]] \[\e[0;90m\](\[\e[0;37m\]\W\[\e[0;90m\]) \[\e[0;37m\]\$\[\e[0m\] "
|
||||||
|
|||||||
Reference in New Issue
Block a user