Compare commits
3 Commits
c2cf5c3662
...
b0692ec0fd
Author | SHA1 | Date | |
---|---|---|---|
b0692ec0fd
|
|||
7bd940d717
|
|||
17766d4035
|
@ -1,49 +0,0 @@
|
|||||||
# ~/.profile: executed by the command interpreter for login shells.
|
|
||||||
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
|
|
||||||
# exists.
|
|
||||||
# see /usr/share/doc/bash/examples/startup-files for examples.
|
|
||||||
# the files are located in the bash-doc package.
|
|
||||||
|
|
||||||
# the default umask is set in /etc/profile; for setting the umask
|
|
||||||
# for ssh logins, install and configure the libpam-umask package.
|
|
||||||
#umask 022
|
|
||||||
|
|
||||||
# if running bash
|
|
||||||
if [ -n "$BASH_VERSION" ]; then
|
|
||||||
# include .bashrc if it exists
|
|
||||||
if [ -f "$HOME/.bashrc" ]; then
|
|
||||||
. "$HOME/.bashrc"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set PATH so it includes user's private bin if it exists
|
|
||||||
if [ -d "$HOME/bin" ] ; then
|
|
||||||
PATH="$HOME/bin:$PATH"
|
|
||||||
fi
|
|
||||||
|
|
||||||
PATH=/usr/local/bin:$PATH
|
|
||||||
|
|
||||||
if [ -e `which keychain` ]; then
|
|
||||||
# load SSH key
|
|
||||||
keychain --timeout 240 ~/.ssh/id_rsa
|
|
||||||
source ~/.keychain/$HOSTNAME-sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# some aliases
|
|
||||||
alias vi='vim'
|
|
||||||
alias ta='tmux attach'
|
|
||||||
alias ta2='tmux -2 attach'
|
|
||||||
alias ns='netstat -tulpn'
|
|
||||||
alias llh='ls -lh'
|
|
||||||
alias ll='ls -lp'
|
|
||||||
alias ls='ls -p'
|
|
||||||
|
|
||||||
# set 1337 h4x0r looking shell prompt
|
|
||||||
#PS1="\w > "
|
|
||||||
PS1='\[\e[1;32m\][\u@\h \w]\$\[\e[0m\] '
|
|
||||||
|
|
||||||
[[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
|
|
||||||
|
|
||||||
export EDITOR=vim
|
|
||||||
|
|
||||||
source /usr/local/share/chruby/chruby.sh
|
|
73
.bashrc
Normal file
73
.bashrc
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# Source global definitions
|
||||||
|
if [ -f /etc/bashrc ]; then
|
||||||
|
. /etc/bashrc
|
||||||
|
fi
|
||||||
|
|
||||||
|
function debug() {
|
||||||
|
if [[ -v "$DEBUG" ]]; then
|
||||||
|
echo "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Run systemd generators
|
||||||
|
if [[ -f /usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator ]]; then
|
||||||
|
set -o allexport
|
||||||
|
# shellcheck disable=1090
|
||||||
|
source <(/usr/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)
|
||||||
|
set +o allexport
|
||||||
|
fi
|
||||||
|
|
||||||
|
# User specific environment
|
||||||
|
if ! [[ "$PATH" =~ $HOME/.local/bin:$HOME/bin: ]]; then
|
||||||
|
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# User specific aliases and functions
|
||||||
|
if [ -d ~/.bashrc.d ]; then
|
||||||
|
for rc in ~/.bashrc.d/*; do
|
||||||
|
if [ -f "$rc" ]; then
|
||||||
|
# shellcheck disable=1090
|
||||||
|
. "$rc"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
unset rc
|
||||||
|
|
||||||
|
# Environment variables
|
||||||
|
|
||||||
|
# history control
|
||||||
|
HISTSIZE=10000
|
||||||
|
HISTFILESIZE=$HISTSIZE
|
||||||
|
HISTCONTROL=ignorespace:ignoredups
|
||||||
|
shopt -s histappend
|
||||||
|
|
||||||
|
if command -v nvim > /dev/null; then
|
||||||
|
debug "✅ setting EDITOR to nvim"
|
||||||
|
export EDITOR=nvim
|
||||||
|
|
||||||
|
debug "✅ setting MANPAGER viewer to nvim"
|
||||||
|
export MANPAGER="nvim +Man!"
|
||||||
|
else
|
||||||
|
debug "⚠️ nvim not found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Tools
|
||||||
|
|
||||||
|
# fzf
|
||||||
|
if command -v fzf > /dev/null; then
|
||||||
|
eval "$(fzf "--$(basename "$SHELL")")"
|
||||||
|
debug "✅ set up fzf"
|
||||||
|
else
|
||||||
|
debug "⚠️ fzf not found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# starship
|
||||||
|
if command -v starship > /dev/null; then
|
||||||
|
eval "$(starship init "$(basename "$SHELL")")"
|
||||||
|
debug "✅ set up starship"
|
||||||
|
else
|
||||||
|
debug "⚠️ starship not found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Aliases
|
||||||
|
alias nview="nvim -R"
|
40
.profile
40
.profile
@ -1,44 +1,8 @@
|
|||||||
# ~/.profile: executed by the command interpreter for login shells.
|
|
||||||
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
|
|
||||||
# exists.
|
|
||||||
# see /usr/share/doc/bash/examples/startup-files for examples.
|
|
||||||
# the files are located in the bash-doc package.
|
|
||||||
|
|
||||||
# the default umask is set in /etc/profile; for setting the umask
|
|
||||||
# for ssh logins, install and configure the libpam-umask package.
|
|
||||||
#umask 022
|
|
||||||
|
|
||||||
# if running bash
|
# if running bash
|
||||||
if [ -n "$BASH_VERSION" ]; then
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
# include .bashrc if it exists
|
# include .bashrc if it exists
|
||||||
if [ -f "$HOME/.bashrc" ]; then
|
if [ -f "$HOME/.bashrc" ]; then
|
||||||
. "$HOME/.bashrc"
|
# shellcheck disable=SC1090
|
||||||
|
. "$HOME/.bashrc"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set PATH so it includes user's private bin directories
|
|
||||||
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
|
|
||||||
|
|
||||||
export EDITOR=vim
|
|
||||||
export GPG_TTY=$(tty)
|
|
||||||
|
|
||||||
if [ ! -e /run/systemd/system ]; then
|
|
||||||
SSH_ENV="${HOME}/.ssh/env"
|
|
||||||
|
|
||||||
function start_ssh_agent {
|
|
||||||
ssh-agent | sed -e '/^echo/d' > "${SSH_ENV}"
|
|
||||||
chmod 0600 "${SSH_ENV}"
|
|
||||||
. "${SSH_ENV}"
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -f "${SSH_ENV}" ]; then
|
|
||||||
. "${SSH_ENV}"
|
|
||||||
if ! kill -0 "${SSH_AGENT_PID}" > /dev/null 2>&1; then
|
|
||||||
start_ssh_agent
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
start_ssh_agent
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
|
|
||||||
fi
|
|
||||||
|
Reference in New Issue
Block a user