This commit is contained in:
Morten Olsen
2023-09-16 12:33:21 +02:00
parent 6dbaad1bbe
commit 33f79566b7
65 changed files with 387 additions and 228 deletions

View File

@@ -0,0 +1,9 @@
# Load all files from .shell/rc.d directory
if [ -d $HOME/.shellrc/rc.d ]; then
for file in $HOME/.shellrc/rc.d/*.sh; do
source $file
done
fi
[ -f ~/.fzf.bash ] && source ~/.fzf.bash

View File

@@ -0,0 +1 @@
GH_TOKEN=op://2w4xwvwqj6r33yqeaxbwanup6q/olcqxk6mox3a5ytzslws3itf3m/GH_TOKEN

View File

@@ -0,0 +1,2 @@
export PATH="$PATH:$HOME/.local/bin"

View File

@@ -0,0 +1,34 @@
alias ..="cd .."
alias g="git"
alias ls="eza"
alias mutt="neomutt"
alias gr="cd \`git rev-parse --show-toplevel\`"
# Enable aliases to be sudoed
alias sudo='sudo '
# Get week number
alias week='date +%V'
# macOS has no `md5sum`, so use `md5` as a fallback
command -v md5sum > /dev/null || alias md5sum="md5"
# macOS has no `sha1sum`, so use `shasum` as a fallback
command -v sha1sum > /dev/null || alias sha1sum="shasum"
# Print each PATH entry on a separate line
alias path='echo -e ${PATH//:/\\n}'
# Enable tab completion for `g` by marking it as an alias for `git`
command -v _git > /dev/null && command -v complete > /dev/null && complete -o default -o nospace -F _git g
command -v xsel > /dev/null || alias copy='xsel -ib'
command -v urxvt > /dev/null || alias n="setsid urxvt &>/dev/null"
alias sc="sudo systemctl"
alias usermount="sudo mount -o gid=users,fmask=113,dmask=002"
alias fzf="fzf --preview 'bat {} --line-range 0:100 --color always'"
alias stmux="tmux a -t base || tmux new -s base"

View File

@@ -0,0 +1,6 @@
if hash bat &> /dev/null; then
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export BAT_THEME="MonokaiExtended"
alias cat="bat"
fi

View File

@@ -0,0 +1,8 @@
export TMPDIR=${TMPDIR:-/tmp}
if ! pgrep -U "$UID" ssh-agent > /dev/null; then
ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env"
fi
if [[ ! "$SSH_AUTH_SOCK" ]]; then
eval "$(<"$XDG_RUNTIME_DIR/ssh-agent.env")"
fi

View File

@@ -0,0 +1,7 @@
export GH_TOKEN=${GH_TOKEN:-unset}
export NPM_GH_TOKEN=${GH_TOKEN:-unset}
export NPM_NPM_TOKEN=${NPM_NPM_TOKEN:-unset}
export PUBLISH_NPM_GITLAB_TOKEN=${NPM_NPM_TOKEN:-unset}
export NPM_PRIVATE_TOKEN=${NPM_PRIVATE_TOKEN:-unset}
npm set prefix ~/.npm-global

View File

@@ -0,0 +1 @@
export FZF_DEFAULT_COMMAND='ag -g ""'

View File

@@ -0,0 +1,5 @@
export GPG_TTY="$(tty)"
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent
gpg-connect-agent updatestartuptty /bye > /dev/null

View File

@@ -0,0 +1,3 @@
export EDITOR=nvim
alias vim=nvim

View File

@@ -0,0 +1,26 @@
function _bw_replace_env() {
env | while IFS= read -r line; do
value=${line#*=}
name=${line%%=*}
if [[ $value = bw://* ]]; then;
item=${value:5}
secret=`bw get password $item`
export $name="$secret"
fi
done
}
function clam-open() {
command=$1
if [[ -z "$BW_SESSION" ]]; then;
export BW_SESSION=`bw unlock --raw`
fi
_bw_replace_env
if [[ ! -z "$command" ]]; then;
eval $command
fi
}
function clam-close() {
unset BW_SESSION
}

View File

@@ -0,0 +1,98 @@
export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-$HOME/.cache}
export ZSH="$HOME/.oh-my-zsh"
export ZSH_CUSTOM="$HOME/.config/zsh/custom"
ZSH_THEME="robbyrussell"
plugins=(
git
zsh-autosuggestions
copypath
copyfile
copybuffer
dirhistory
history
z
bgnotify
zsh-syntax-highlighting
)
source $ZSH/oh-my-zsh.sh
export LANG=en_US.UTF-8
plugins+=(zsh-vi-mode)
source $ZSH_CUSTOM/zsh-vi-mode/zsh-vi-mode.plugin.zsh
zvm_after_init() {
FZF_SHARE=/usr/share/fzf
[ -f $FZF_SHARE/completion.zsh ] && . "$FZF_SHARE/completion.zsh"
[ -f $FZF_SHARE/key-bindings.zsh ] && . "$FZF_SHARE/key-bindings.zsh"
}
# Load all files from .shell/rc.d directory
if [ -d $HOME/.shellrc/rc.d ]; then
for file in $HOME/.shellrc/rc.d/*.sh; do
source $file
done
for file in $HOME/.shellrc/rc.d/*.zsh; do
source $file
done
fi
# Load all files from .shell/zshrc.d directory
if [ -d $HOME/.shellrc/zshrc.d ]; then
for file in $HOME/.shellrc/zshrc.d/*.zsh; do
source $file
done
fi
export GPG_TTY=$(tty)
if [[ -n "$SSH_CONNECTION" ]] ;then
export PINENTRY_USER_DATA="USE_CURSES=1"
fi
[ -f ~/.env ] && source ~/.env
alias luamake=~/.config/lua-language-server/3rd/luamake/luamake
if [ `tput cols` -gt "70" ]; then
function PRINT_CENTER {
COLS=`tput cols`
OFFSET=$(( ($COLS - $1) / 2 ))
PRE=""
for i in `seq $OFFSET`; do
PRE="$PRE "
done
while IFS= read -r line; do
echo "$PRE$line"
done <<< "$2"
}
PRINT_CENTER 60 "
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█░▄▄▀█▀▄▄▀█░▄▄░█▄░▄█▀▄▀██░▄░██░██░█░▄▄█░▄▄░█
█░▀▀▄█░██░█░▀▄░██░██░█▀█░▀▀░▀█░██░█▄▄▀███▄██
█▄█▄▄██▄▄██░▀▀░██▄███▄█████░███▄▄▄█▄▄▄█░▀▀░█
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆
⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦
⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄
⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄
⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀
⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄
⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄
⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄
⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄
⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆
⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃
▄▄▄ . ▌ ▐·▪ ▄▄▌ ▄▄▌ ▐ ▄▌▪ ▄▄▄▄▄ ▄ .▄ ▄• ▄▌▄▄▄▄▄
▀▄.▀·▪█·█▌██ ██• ██· █▌▐███ •██ ██▪▐█ ▄█▀▄ █▪██▌•██
▐▀▀▪▄▐█▐█•▐█·██ ▪ ██▪▐█▐▐▌▐█· ▐█.▪██▀▀█▐█▌.▐▌█▌▐█▌ ▐█.▪
▐█▄▄▌ ███ ▐█▌▐█▌ ▄ ▐█▌██▐█▌▐█▌ ▐█▌·██▌▐▀▐█▌.▐▌▐█▄█▌ ▐█▌·
▀▀▀ . ▀ ▀▀▀.▀▀▀ ▀▀▀▀ ▀▪▀▀▀ ▀▀▀ ▀▀▀ · ▀█▄▀▪ ▀▀▀ ▀▀▀
> welcome x_x
"
fi
which wrk > /dev/null && eval `wrk tools bash`