aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2023-03-20 09:48:45 +0800
committerHsieh Chin Fan <pham@topo.tw>2023-03-20 09:48:45 +0800
commita3c048ab4dc5e6e480e0331ac682dd69376856dd (patch)
tree1d1d63cec85a9165359f4ca7c9ad7bd9d94e9e51
parentd366d6131dbe3c53ba64246f4ecf49acf43c9ce2 (diff)
Improve load-settings.sh
-rwxr-xr-xbin/init/load-settings.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/init/load-settings.sh b/bin/init/load-settings.sh
index 6df3047..cd31f76 100755
--- a/bin/init/load-settings.sh
+++ b/bin/init/load-settings.sh
@@ -4,14 +4,16 @@ export SETTING_DIR=${SETTING_DIR:=$HOME/helper}
4export EDITOR=vim 4export EDITOR=vim
5export TERM=xterm-256color 5export TERM=xterm-256color
6export XDG_CONFIG_HOME=~/.config 6export XDG_CONFIG_HOME=~/.config
7export MAIL=$HOME/Maildir
7 8
8# Get current shell 9# Get current shell
9export shell=$(</proc/$$/cmdline sed -E 's/(.)-.+$/\1/' | tr -d '[\0\-]') 10shell=$(</proc/$$/cmdline sed -E 's/(.)-.+$/\1/' | tr -d '[\0\-]')
10export shell=${shell##*/} 11export shell=${shell##*/}
11 12
12# load custom aliases 13# load custom aliases
13source $SETTING_DIR/alias 14source $SETTING_DIR/alias
14[[ -d $SETTING_DIR/private ]] && for f in $SETTING_DIR/private/*; do source $f; done 15[[ -d $SETTING_DIR/private ]] && for f in $SETTING_DIR/private/*; do source $f; done
16find $SETTING_DIR/bin -not -executable -name '*rc' | while read rcfile; do source $rcfile; done
15 17
16# Add custom scripts into PATH 18# Add custom scripts into PATH
17BIN_DIR=$HOME/bin 19BIN_DIR=$HOME/bin
@@ -21,9 +23,6 @@ find $BIN_DIR -xtype l -exec rm {} + 2>/dev/null
21find $SETTING_DIR/bin -type f -executable -exec realpath {} + | \ 23find $SETTING_DIR/bin -type f -executable -exec realpath {} + | \
22xargs -I{} ln -sf {} $BIN_DIR 24xargs -I{} ln -sf {} $BIN_DIR
23 25
24# Mail
25MAIL=$HOME/Maildir
26
27# sync with important git repos 26# sync with important git repos
28setsid sync.sh 27setsid sync.sh
29 28
@@ -66,6 +65,6 @@ if [[ $- =~ i ]]; then
66fi 65fi
67 66
68# Working DIR 67# Working DIR
69[[ `pwd` == $HOME ]] && cd ~/Downloads 68[[ `pwd` == $HOME ]] && test -d ~/Downloads && cd ~/Downloads
70 69
71true 70true