2019-12-02 17:16:05 +00:00
|
|
|
#!/bin/zsh
|
2020-09-17 03:06:44 +00:00
|
|
|
|
2020-01-08 19:40:53 +00:00
|
|
|
source "$HOME/.wryn/env/env.zsh"
|
2019-12-02 17:16:05 +00:00
|
|
|
|
|
|
|
RC_DIR="$DOTWRYN/zsh"
|
2021-02-23 20:37:37 +00:00
|
|
|
source "$DOTWRYN/zsh/config"
|
2019-12-02 17:16:05 +00:00
|
|
|
|
2020-11-04 21:13:41 +00:00
|
|
|
# --- load custom plugins ------------------------------------------
|
|
|
|
|
2021-02-23 20:37:37 +00:00
|
|
|
for file in $(find $RC_DIR -maxdepth 1 -type f ! -name 'rc' ! -name 'config'); do source $file; done;
|
2019-12-02 17:16:05 +00:00
|
|
|
|
2020-11-04 21:13:41 +00:00
|
|
|
# operating system specific plugins
|
|
|
|
case "$OSTYPE" in
|
|
|
|
linux-gnu )
|
|
|
|
for file in $(find $RC_DIR/linux -type f); do source $file; done;
|
|
|
|
;;
|
|
|
|
darwin* )
|
|
|
|
for file in $(find $RC_DIR/osx -type f); do source $file; done;
|
|
|
|
;;
|
|
|
|
esac
|
2019-12-02 17:16:05 +00:00
|
|
|
|
|
|
|
|
2020-11-04 21:13:41 +00:00
|
|
|
# --- set default editor -------------------------------------------
|
|
|
|
SET_PREFERRED_EDITOR() {
|
2020-11-10 23:14:06 +00:00
|
|
|
# load preference from environment (vi vim) by default
|
|
|
|
[[ -z $PREFERRED_EDITOR ]] && { echo 'unable to find $PREFERRED_EDITOR environment variable'; return 1; }
|
2019-12-02 17:16:05 +00:00
|
|
|
|
2020-11-10 23:14:06 +00:00
|
|
|
[[ $EDITOR == "${PREFERRED_EDITOR[-1]}" ]] && [[ $VISUAL == "${PREFERENCE[-1]}" ]] && return 0;
|
2020-11-04 21:13:41 +00:00
|
|
|
|
|
|
|
local AVAILABLE_EDITOR="$EDITOR";
|
|
|
|
|
2020-11-10 23:14:06 +00:00
|
|
|
for program in $PREFERRED_EDITOR; do which $program >/dev/null 2>&1 && AVAILABLE_EDITOR="$program"; done
|
2019-12-02 17:16:05 +00:00
|
|
|
|
2020-11-04 21:13:41 +00:00
|
|
|
export EDITOR="$AVAILABLE_EDITOR";
|
|
|
|
export VISUAL="$AVAILABLE_EDITOR";
|
2020-11-04 19:57:36 +00:00
|
|
|
}
|
2020-11-04 21:13:41 +00:00
|
|
|
SET_PREFERRED_EDITOR
|
2019-12-02 17:16:05 +00:00
|
|
|
|
2020-06-22 18:06:12 +00:00
|
|
|
|
2020-11-04 19:57:36 +00:00
|
|
|
# --- welcome message ----------------------------------------------
|
2020-12-02 19:14:36 +00:00
|
|
|
CUSTOM_WELCOME="$HOME/.config/wryn/custom-welcome"
|
|
|
|
[ -f "$CUSTOM_WELCOME" ] \
|
|
|
|
&& { "$CUSTOM_WELCOME" } \
|
|
|
|
|| { exec figlet "Welcome, beautiful" | lolcat; echo; cowsay -p "damn u sexy" | lolcat; }
|