mirror of
https://github.com/morten-olsen/nixos-config.git
synced 2026-02-08 00:36:27 +01:00
update
This commit is contained in:
9
user/programs/terminal/files/bashrc
Normal file
9
user/programs/terminal/files/bashrc
Normal 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
|
||||
|
||||
1
user/programs/terminal/files/env
Normal file
1
user/programs/terminal/files/env
Normal file
@@ -0,0 +1 @@
|
||||
GH_TOKEN=op://2w4xwvwqj6r33yqeaxbwanup6q/olcqxk6mox3a5ytzslws3itf3m/GH_TOKEN
|
||||
0
user/programs/terminal/files/shell/rc.d/00-vars.sh
Normal file
0
user/programs/terminal/files/shell/rc.d/00-vars.sh
Normal file
2
user/programs/terminal/files/shell/rc.d/01-scripts.sh
Normal file
2
user/programs/terminal/files/shell/rc.d/01-scripts.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
export PATH="$PATH:$HOME/.local/bin"
|
||||
|
||||
34
user/programs/terminal/files/shell/rc.d/02-alias.sh
Normal file
34
user/programs/terminal/files/shell/rc.d/02-alias.sh
Normal 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 sudo’ed
|
||||
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"
|
||||
|
||||
6
user/programs/terminal/files/shell/rc.d/02-bat.sh
Normal file
6
user/programs/terminal/files/shell/rc.d/02-bat.sh
Normal 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
|
||||
|
||||
8
user/programs/terminal/files/shell/rc.d/03-ssh.sh
Normal file
8
user/programs/terminal/files/shell/rc.d/03-ssh.sh
Normal 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
|
||||
7
user/programs/terminal/files/shell/rc.d/05-npm.sh
Normal file
7
user/programs/terminal/files/shell/rc.d/05-npm.sh
Normal 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
|
||||
|
||||
1
user/programs/terminal/files/shell/rc.d/07-fzf.sh
Normal file
1
user/programs/terminal/files/shell/rc.d/07-fzf.sh
Normal file
@@ -0,0 +1 @@
|
||||
export FZF_DEFAULT_COMMAND='ag -g ""'
|
||||
5
user/programs/terminal/files/shell/rc.d/10-gpg-agent.sh
Normal file
5
user/programs/terminal/files/shell/rc.d/10-gpg-agent.sh
Normal 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
|
||||
|
||||
3
user/programs/terminal/files/shell/rc.d/10-nvim.sh
Normal file
3
user/programs/terminal/files/shell/rc.d/10-nvim.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
export EDITOR=nvim
|
||||
alias vim=nvim
|
||||
|
||||
26
user/programs/terminal/files/shell/rc.d/10-vault.zsh
Normal file
26
user/programs/terminal/files/shell/rc.d/10-vault.zsh
Normal 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
|
||||
}
|
||||
98
user/programs/terminal/files/zshrc
Normal file
98
user/programs/terminal/files/zshrc
Normal 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`
|
||||
|
||||
Reference in New Issue
Block a user