diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2023-03-20 09:48:45 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2023-03-20 09:48:45 +0800 |
| commit | a3c048ab4dc5e6e480e0331ac682dd69376856dd (patch) | |
| tree | 1d1d63cec85a9165359f4ca7c9ad7bd9d94e9e51 /bin/init | |
| parent | d366d6131dbe3c53ba64246f4ecf49acf43c9ce2 (diff) | |
Improve load-settings.sh
Diffstat (limited to 'bin/init')
| -rwxr-xr-x | bin/init/load-settings.sh | 9 |
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} | |||
| 4 | export EDITOR=vim | 4 | export EDITOR=vim |
| 5 | export TERM=xterm-256color | 5 | export TERM=xterm-256color |
| 6 | export XDG_CONFIG_HOME=~/.config | 6 | export XDG_CONFIG_HOME=~/.config |
| 7 | export MAIL=$HOME/Maildir | ||
| 7 | 8 | ||
| 8 | # Get current shell | 9 | # Get current shell |
| 9 | export shell=$(</proc/$$/cmdline sed -E 's/(.)-.+$/\1/' | tr -d '[\0\-]') | 10 | shell=$(</proc/$$/cmdline sed -E 's/(.)-.+$/\1/' | tr -d '[\0\-]') |
| 10 | export shell=${shell##*/} | 11 | export shell=${shell##*/} |
| 11 | 12 | ||
| 12 | # load custom aliases | 13 | # load custom aliases |
| 13 | source $SETTING_DIR/alias | 14 | source $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 |
| 16 | find $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 |
| 17 | BIN_DIR=$HOME/bin | 19 | BIN_DIR=$HOME/bin |
| @@ -21,9 +23,6 @@ find $BIN_DIR -xtype l -exec rm {} + 2>/dev/null | |||
| 21 | find $SETTING_DIR/bin -type f -executable -exec realpath {} + | \ | 23 | find $SETTING_DIR/bin -type f -executable -exec realpath {} + | \ |
| 22 | xargs -I{} ln -sf {} $BIN_DIR | 24 | xargs -I{} ln -sf {} $BIN_DIR |
| 23 | 25 | ||
| 24 | |||
| 25 | MAIL=$HOME/Maildir | ||
| 26 | |||
| 27 | # sync with important git repos | 26 | # sync with important git repos |
| 28 | setsid sync.sh | 27 | setsid sync.sh |
| 29 | 28 | ||
| @@ -66,6 +65,6 @@ if [[ $- =~ i ]]; then | |||
| 66 | fi | 65 | fi |
| 67 | 66 | ||
| 68 | # Working DIR | 67 | # Working DIR |
| 69 | [[ `pwd` == $HOME ]] && cd ~/Downloads | 68 | [[ `pwd` == $HOME ]] && test -d ~/Downloads && cd ~/Downloads |
| 70 | 69 | ||
| 71 | true | 70 | true |