Commit bd0e2016 authored by GeekTR's avatar GeekTR 💬
Browse files

commit message

parent deb2c4a8
Showing with 152 additions and 1 deletion
+152 -1
dist
\ No newline at end of file
.profile 0 → 100644
#!/usr/bin/env bash
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# include .secret if it exists
# .secret file includes secret enviroment variables
if [ -f "$HOME/.secret" ]; then
. "$HOME/.secret"
fi
# add bins to path
AVAILABLE_PATH=(
"$HOME/.bin"
# python packages
"$HOME/.local/bin"
# node packages
"$HOME/.npm-global/bin"
)
for i in "${AVAILABLE_PATH[@]}"
do
if [ -f "$i" ]; then
PATH="$i:$PATH"
fi
done
# import `~/.profile-bundle`
PROFILE_BUNDLE="$HOME/.profile-bundle"
if [ -f "$PROFILE_BUNDLE" ]; then
. "$PROFILE_BUNDLE"
fi
# update home
function gtr::update-home {
bash -c "$(wget -qO- https://flint.geektr.co/home/init.sh)"
}
#!/usr/bin/env bash
ex-chrome() {
chromium-browser --user-data-dir=/home/geektr/.config/ex-chrome --proxy-server=http://proxy.local.geektr.co:3128
}
#!/usr/bin/env bash
# if current directory contains ".vscode/.zshrc", ask if source it
gtr::read_char() {
stty -icanon -echo
eval "$1=\$(dd bs=1 count=1 2>/dev/null)"
stty icanon echo
}
if [ -f "$PWD/.vscode/.zshrc" ]; then
tee <<EOT
Current Directory Contains '.vscode/.zshrc'
- press 'y' to source it
- press 'v' to view it using 'less'
- press anything else to skip this
EOT
while gtr::read_char user_answer; do
case "$user_answer" in
y) source "$PWD/.vscode/.zshrc"; break ;;
v) less "$PWD/.vscode/.zshrc" ;;
*) break ;;
esac
done
fi
#!/usr/bin/env bash
ssh--kami() {
ssh -i "$HOME/.ssh/keys/geektr.co/kami" "kami@$1"
}
ssh--geektr() {
ssh -i "$HOME/.ssh/keys/geektr.co/geektr" "geektr@$1"
}
ssh--yumemi() {
ssh -i "$HOME/.ssh/keys/geektr.co/yumemi" "yumemi@$1"
}
.zshrc 0 → 100644
#!/usr/bin/env bash
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME=""
DISABLE_UPDATE_PROMPT=true
DISABLE_AUTO_UPDATE=true
plugins=(git docker python tmux npm yarn)
if [ -f "$HOME/.profile" ]; then
source "$HOME/.profile"
fi
if [ -f "$ZSH/oh-my-zsh.sh" ]; then
source "$ZSH/oh-my-zsh.sh"
fi
if [ -f "$HOME/.acme.sh/acme.sh.env" ]; then
. "$HOME/.acme.sh/acme.sh.env"
fi
function upgrade-pure {
RES_PREFIX=https://raw.githubusercontent.com/sindresorhus/pure/master
DIST_PREFIX=/usr/local/share/zsh/site-functions/
sudo wget -q -O "$DIST_PREFIX/prompt_pure_setup" "$RES_PREFIX/pure.zsh"
sudo wget -q -O "$DIST_PREFIX/async" "$RES_PREFIX/async.zsh"
}
autoload -U promptinit; promptinit
prompt pure
# Home
Home directory for my linux PC
\ No newline at end of file
Home directory for my linux PC
## Usage
```bash
bash -c "$(wget -qO- https://flint.geektr.co/home/init.sh)"
```
build.sh 0 → 100755
#!/usr/bin/env bash
oss_upload() {
ossutil cp -r "$1" oss://co-geektr-flint/home/"$2" --acl public-read -f
}
# build
bundle=dist/.profile-bundle
find ".profiles" -type f -exec cat "{}" > "$bundle" \;
# copy to home path
cp $bundle "$HOME/.profile-bundle"
cp .zshrc "$HOME/.zshrc"
cp .profile "$HOME/.profile"
# upload
oss_upload init.sh
oss_upload .profile
oss_upload .zshrc
oss_upload $bundle
init.sh 0 → 100644
#!/usr/bin/env bash
FINT_PREFIX=https://flint.geektr.co/home
flint_download() {
wget -q -O "$HOME/$1" "$FINT_PREFIX/$1"
}
flint_download .profile-bundle
flint_download .profile
flint_download .zshrc
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment