-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshellrc.sh
executable file
·81 lines (68 loc) · 2.11 KB
/
shellrc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/sh
#
# Shell script that can be included into .bashrc or .zshrc
#
[ -z "$PS1" ] && return
#[ -f ${HOME}/.profile ] && . ${HOME}/.profile
# script base
if [ ! -z "${BASH_VERSION}" ]; then
SCRIPT_BASE_DIR="$(dirname "$BASH_SOURCE")"
fi
if [ ! -z "${ZSH_VERSION}" ]; then
SCRIPT_BASE_DIR="$(dirname "${(%):-%N}")"
fi
export SCRIPT_BASE_DIR
# source the core
source ${SCRIPT_BASE_DIR}/core.sh
# bash specific
if [ ! -z "${BASH_VERSION}" ]; then
export SHELL_TYPE=bash
source ${SCRIPT_BASE_DIR}/bashrc.sh
fi
# zsh specific
if [ ! -z "${ZSH_VERSION}" ]; then
export SHELL_TYPE=zsh
source ${SCRIPT_BASE_DIR}/zshrc.sh
fi
# OSX specific
if [ "$(uname)" = "Darwin" ]; then
source ${SCRIPT_BASE_DIR}/darwin.sh
fi
# Linux specific
if [ "$(uname)" = "Linux" ]; then
source ${SCRIPT_BASE_DIR}/linux.sh
fi
# Cygwin specific
if echo "$(uname)" | grep -q -i 'cygwin'; then
source ${SCRIPT_BASE_DIR}/cygwin.sh
fi
# Universal utils
. "${SCRIPT_BASE_DIR}/utils/mkvMergeSub.sh"
. "${SCRIPT_BASE_DIR}/utils/createShellCommandFromJar.sh"
[ -e "${SCRIPT_BASE_DIR}/utils/z/z.sh" ] && . "${SCRIPT_BASE_DIR}/utils/z/z.sh"
. "${SCRIPT_BASE_DIR}/utils/ipv6-utils.sh"
. "${SCRIPT_BASE_DIR}/utils/ffmpeg-utils.sh"
. "${SCRIPT_BASE_DIR}/utils/uibuilder.sh"
alias imgcat="${SCRIPT_BASE_DIR}/utils/imgcat.sh"
alias imgls="${SCRIPT_BASE_DIR}/utils/imgls.sh"
alias format-number="${SCRIPT_BASE_DIR}/utils/format-number.sh"
alias currency-exchange="${SCRIPT_BASE_DIR}/utils/currency-exchange.sh"
alias unicode="${SCRIPT_BASE_DIR}/utils/unicode.py"
alias dupli="${SCRIPT_BASE_DIR}/utils/dupli.py"
alias to-monospace="${SCRIPT_BASE_DIR}/utils/to-monospace.sh"
# show status if exists
if [ -x ~/bin/status.sh ]; then
bash ~/bin/status.sh
fi
# force en_US and utf-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# fzf
export FZF_DEFAULT_COMMAND='fd --type f --color=never'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND='fd --type d . --color=never'
export FZF_DEFAULT_OPTS='--height 75% --multi --reverse'
export FZF_COMPLETION_TRIGGER='**'
if [ -f ${HOME}/.customshellrc ]; then
. ${HOME}/.customshellrc
fi