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:
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
|
||||
}
|
||||
Reference in New Issue
Block a user