1
0
Files
dotfiles/.bash_profile

83 lines
2.3 KiB
Bash
Raw Permalink Normal View History

2022-01-03 11:33:05 +01:00
#!/bin/sh
# stty (Set TTY) sets up your TTY. Note, if you have problems with
# your backspace key, try changing the "erase '^h'" to "erase '^?'".
# If that still does not help, type stty erase at the shell prompt
# and then hit your backspace key.
2025-01-22 17:22:10 +01:00
stty erase '^h' echoe
2022-01-03 11:33:05 +01:00
2025-01-18 20:47:58 +01:00
# Shell options
2025-01-22 17:22:10 +01:00
shopt -s autocd # AutoCD up with ..
shopt -s histappend # Append history
2025-01-18 17:30:31 +01:00
2025-01-18 20:47:58 +01:00
# Path
2025-01-18 17:30:31 +01:00
export PATH="/usr/sbin:~/bin:$PATH:."
2025-01-08 18:25:38 +01:00
2025-01-18 20:47:58 +01:00
# Set stricter umask
umask 0077
2022-01-03 11:33:05 +01:00
2025-01-18 20:47:58 +01:00
# Vars
2025-01-22 17:22:10 +01:00
export DISPLAY='localhost:0.0'
export EDITOR='nano'
export FIGNORE='.dll:.cpl'
2026-01-26 10:28:36 +01:00
export GREP_COLORS='ms=30;43:fn=94' # https://stackoverflow.com/a/33206814/202114
2025-01-22 17:22:10 +01:00
export HISTCONTROL='ignoreboth:erasedups'
export LANG='en_US.UTF-8'
export LESS='-iRM'
2025-02-08 15:55:16 +01:00
export LYNX_CFG='~/.config/lynx/lynx.cfg'
2025-01-22 17:22:10 +01:00
export TERM='xterm-256color'
export TZ='Europe/Oslo'
2022-01-03 11:33:05 +01:00
2025-01-18 20:47:58 +01:00
# Dircolors
#eval $(dircolors -b $HOME/.config/dircolors/dircolors.monokai)
# Functions
2026-04-01 13:47:25 +02:00
pb() { curl -s -F "files[]=@$1" "https://qu.ax/upload.php" | jq -r '.files[].url'; }
cb() { curl -s -F "reqtype=fileupload" -F "fileToUpload=@$1" "https://catbox.moe/user/api.php"; }
2026-04-16 19:18:36 +02:00
shn() { curl "https://is.gd/create.php?format=simple&url=$1"; }
2025-01-11 16:01:31 +01:00
2025-07-21 12:02:28 +02:00
# Cygwin
2025-06-01 13:14:47 +02:00
if [[ "$(uname)" == *"CYGWIN"* ]]; then
shopt -s completion_strip_exe
alias start='cygstart'
alias cyg-get='cygstart /e/Install/Cygwin/setup-x86_64.exe -qn -P'
alias cyg-update='cygstart /e/Install/Cygwin/setup-x86_64.exe -qng'
alias npp='cygstart /d/bin/Notepad++/notepad++.exe'
alias sublime='cygstart /d/bin/Sublime/sublime_text.exe'
alias sudo='gsudo' # github.com/gerardog/gsudo
fi
2025-01-20 20:24:48 +01:00
2025-01-18 20:47:58 +01:00
# Aliases
2025-01-22 17:22:10 +01:00
alias cd..='cd ..'
alias cls='clear'
alias ls='ls --color=auto --group-directories-first'
alias dir='ls -l'
alias ll='ls -l'
alias la='ls -la'
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
2025-07-21 12:02:28 +02:00
alias grep='grep --color --ignore-case'
2025-05-20 11:06:32 +02:00
alias start-ssh-agent='eval $(keychain --eval)'
2025-01-18 20:47:58 +01:00
2025-01-19 10:31:55 +01:00
# Git Aliases
2025-01-22 17:22:10 +01:00
alias ga='git add -A'
alias gc='git commit'
alias gs='git status'
2026-02-24 19:53:34 +01:00
alias gl='git hist'
alias gw='git hist --raw --no-merges'
2025-01-19 10:31:55 +01:00
2025-01-18 20:47:58 +01:00
# Git Prompt
2026-01-26 10:28:36 +01:00
if [[ -e ~/.config/git/git-prompt.sh ]]; then
source ~/.config/git/git-prompt.sh
export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]$(__git_ps1 " (%s)")\n\$ '
2025-01-22 17:22:10 +01:00
else
2026-01-26 10:28:36 +01:00
export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
2025-01-08 18:46:22 +01:00
fi
2025-01-08 18:25:38 +01:00
2025-01-18 20:47:58 +01:00
# Keychain for SSH Agent
2022-01-03 11:33:05 +01:00
#eval $(keychain --eval)
2025-01-18 20:47:58 +01:00
# Greeting
2022-01-03 11:33:05 +01:00
echo "Welcome to the SDF Public Access UNIX system. (est. 1987)"
date -R