Added bash dotfiles from kanaya
This commit is contained in:
parent
acecc996e4
commit
ed68edf732
|
|
@ -0,0 +1,3 @@
|
||||||
|
#
|
||||||
|
# ~/.bash_logout
|
||||||
|
#
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
#
|
||||||
|
# ~/.bash_profile
|
||||||
|
#
|
||||||
|
|
||||||
|
# Run .profile
|
||||||
|
[[ -f ~/.profile ]] && . ~/.profile
|
||||||
|
|
||||||
|
# Run .bashrc
|
||||||
|
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
||||||
|
|
||||||
113
.bashrc
113
.bashrc
|
|
@ -1 +1,112 @@
|
||||||
# stub
|
#
|
||||||
|
# ~/.bashrc
|
||||||
|
#
|
||||||
|
|
||||||
|
# If not running interactively, don't do anything
|
||||||
|
[[ $- != *i* ]] && return
|
||||||
|
|
||||||
|
# Bash settings
|
||||||
|
set -o noclobber
|
||||||
|
shopt -s checkwinsize
|
||||||
|
export HISTCONTROL=ignorespace
|
||||||
|
|
||||||
|
# Color output
|
||||||
|
export TERM=xterm-color
|
||||||
|
export GREP_OPTS='--color=auto'
|
||||||
|
export LS_OPTS='--color=auto -hFN --group-directories-first'
|
||||||
|
export LESS="--RAW-CONTROL-CHARS -i"
|
||||||
|
|
||||||
|
man() {
|
||||||
|
env \
|
||||||
|
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
|
||||||
|
LESS_TERMCAP_md=$(printf "\e[1;31m") \
|
||||||
|
LESS_TERMCAP_me=$(printf "\e[0m") \
|
||||||
|
LESS_TERMCAP_se=$(printf "\e[0m") \
|
||||||
|
LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
|
||||||
|
LESS_TERMCAP_ue=$(printf "\e[0m") \
|
||||||
|
LESS_TERMCAP_us=$(printf "\e[1;32m") \
|
||||||
|
man "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
alias ls='ls ${LS_OPTS}'
|
||||||
|
alias grep='grep ${GREP_OPTS}'
|
||||||
|
|
||||||
|
# Aliases and color output
|
||||||
|
alias l='ls -l'
|
||||||
|
alias la='ls -a'
|
||||||
|
alias ll='ls -la'
|
||||||
|
alias dusch='du -sch'
|
||||||
|
alias sorth='sort -hr'
|
||||||
|
|
||||||
|
alias woman='man'
|
||||||
|
alias enby='man'
|
||||||
|
|
||||||
|
# Stop Ctrl-S from doing terminally things in vim
|
||||||
|
vim()
|
||||||
|
{
|
||||||
|
local STTYOPTS="$(stty --save)"
|
||||||
|
stty stop '' -ixoff
|
||||||
|
command vim "$@"
|
||||||
|
stty "$STTYOPTS"
|
||||||
|
}
|
||||||
|
|
||||||
|
vimdiff()
|
||||||
|
{
|
||||||
|
local STTYOPTS="$(stty --save)"
|
||||||
|
stty stop '' -ixoff
|
||||||
|
command vimdiff "$@"
|
||||||
|
stty "$STTYOPTS"
|
||||||
|
}
|
||||||
|
|
||||||
|
alias gvimr='gvim --remote-silent'
|
||||||
|
alias xo='xdg-open'
|
||||||
|
|
||||||
|
alias ps-grep='ps aux | grep'
|
||||||
|
|
||||||
|
alias wine32='env WINEARCH=win32 WINEPREFIX="$HOME/.wine32" wine'
|
||||||
|
|
||||||
|
# TODO: aliases/functions auslagern?
|
||||||
|
|
||||||
|
alias xclip_='xclip -selection clipboard'
|
||||||
|
|
||||||
|
xclip-greppassword() {
|
||||||
|
grepstr="Password: "
|
||||||
|
filename="$1"
|
||||||
|
|
||||||
|
if [ "$#" -ge 2 ]; then
|
||||||
|
grepstr="$1"
|
||||||
|
filename="$2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
grep -m 1 "$grepstr" "$filename" | cut -d " " -f 2 | xclip -r -selection clipboard
|
||||||
|
}
|
||||||
|
|
||||||
|
calc()
|
||||||
|
{
|
||||||
|
echo "$@" | bc
|
||||||
|
}
|
||||||
|
|
||||||
|
#alias su="su -l"
|
||||||
|
|
||||||
|
# Create and cd to tmp dir
|
||||||
|
alias cdtmp='cd $(mktemp -d -p ~/tmp/)'
|
||||||
|
|
||||||
|
# Bash prompt
|
||||||
|
PS1='[\u@\h \W]\$ '
|
||||||
|
|
||||||
|
TRED='\[\e[0;31m\]' # Red
|
||||||
|
TGREEN='\[\e[0;32m\]' # Green
|
||||||
|
TBLUE='\[\e[1;34m\]' # Blue
|
||||||
|
TWHITEB='\[\e[1;37m\]' # White bold
|
||||||
|
TRESET='\[\e[0m\]' # Text Reset
|
||||||
|
|
||||||
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
|
PS1="${TRED}\u@\h ${TBLUE}\w ${TWHITEB}\$ ${TRESET}"
|
||||||
|
else
|
||||||
|
PS1="${TGREEN}\u@\h ${TBLUE}\w ${TWHITEB}\$ ${TRESET}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PROMPT_DIRTRIM=3
|
||||||
|
|
||||||
|
unset TRED TGREEN TBLUE TWHITEB TRESET
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# SSH key agent started by systemd user
|
||||||
|
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.sock"
|
||||||
|
|
||||||
|
# GPG key stuff
|
||||||
|
export GPG_TTY=$(tty)
|
||||||
|
|
||||||
|
# Environment variables
|
||||||
|
export TERMINAL=sakura
|
||||||
|
export EDITOR=vim
|
||||||
|
export BC_ENV_ARGS="-lq $HOME/.bcrc"
|
||||||
|
|
||||||
|
# PATH
|
||||||
|
export PATH="$HOME/bin:$PATH"
|
||||||
|
#export PATH="/opt/mxe/usr/bin:$PATH"
|
||||||
|
|
||||||
|
# Android SDK stuff
|
||||||
|
export ANDROID_HOME="/opt/Android_SDK"
|
||||||
|
export NDK_ROOT="/opt/Android_SDK/ndk-bundle"
|
||||||
|
export ANDROID_SDK_ROOT="/opt/Android_SDK"
|
||||||
|
export ANT_ROOT="/usr/bin"
|
||||||
|
|
||||||
|
# Wine: do not change filetype associations
|
||||||
|
export WINEDLLOVERRIDES=winemenubuilder.exe=d
|
||||||
|
|
||||||
|
|
@ -42,5 +42,8 @@ makelink_simple() {
|
||||||
makelink "$dotfiles/bin/" bin
|
makelink "$dotfiles/bin/" bin
|
||||||
|
|
||||||
# dotfiles
|
# dotfiles
|
||||||
|
makelink_simple .profile
|
||||||
makelink_simple .bashrc
|
makelink_simple .bashrc
|
||||||
|
makelink_simple .bash_profile
|
||||||
|
makelink_simple .bash_logout
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue