From b628bd4ca2d08400a63f7ebef6a4b31b46f0bb47 Mon Sep 17 00:00:00 2001 From: xshin404 Date: Fri, 9 Apr 2021 02:40:40 +0700 Subject: [PATCH] myTermux-v.0.4.3 pre --- .tmux-themepack | 1 - .xshin.var | 55 +++++++++++++++++++++++++++++++++++++++---------- install.sh | 5 +++++ 3 files changed, 49 insertions(+), 12 deletions(-) delete mode 160000 .tmux-themepack diff --git a/.tmux-themepack b/.tmux-themepack deleted file mode 160000 index 7c59902..0000000 --- a/.tmux-themepack +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7c59902f64dcd7ea356e891274b21144d1ea5948 diff --git a/.xshin.var b/.xshin.var index 340d740..19c110b 100644 --- a/.xshin.var +++ b/.xshin.var @@ -48,8 +48,11 @@ function banner() { function reposize() { if [ "$#" -eq 2 ]; then + echo "$(echo "scale=2 + $(curl https://api.github.com/repos/$1/$2 2>/dev/null | grep size | head -1 | tr -dc '[:digit:]') / 1024" | bc) MB" + fi } @@ -76,7 +79,6 @@ vardotfiles=( ".color-toys" ".zshrc" ".tmux.conf" - ".tmux-themepack" ".termux" ) @@ -118,7 +120,7 @@ function dotfiles() { sleep 2 cp $DIR/$dotfile $HOME/$dotfile - check() { + function check() { if [[ -f $HOME/$dotfile ]]; then @@ -147,7 +149,7 @@ function dotfiles() { sleep 2 cp -R $DIR/$dotfile $HOME/$dotfile - check() { + function check() { if [[ -d $HOME/$dotfile ]]; then @@ -191,6 +193,35 @@ function dotfiles() { } +function tmuxtheme() { + + echo -e "\n⚙️ Installing tmux-theme\n" + + start_spinner "‏‏‎‏‏‎ ‎‏‏‎ ‎📦 tmux-themepack" + git clone https://github.com/jimeh/tmux-themepack.git ~/.tmux-themepack/ &>/dev/null + + function check() { + + if [[ -d ~/.tmux-themepack ]]; then + + stop_spinner $? + + else + + cp "empty" > /dev/null 2>&1 + stop_spinner $? + start_spinner "‏‏‎‏‏‎ ‎‏‏‎ ‎📦 tmux-themepack" + git clone https://github.com/jimeh/tmux-themepack.git ~/.tmux-themepack/ &>/dev/null + check + + fi + + } + + check + +} + # Lightweight Installation lightweightpkgs=( @@ -228,7 +259,7 @@ function lightweightpackage() { start_spinner "‏‏‎‏‏‎ ‎‏‏‎ ‎📦 $lightweightpkg" pkg install -y $lightweightpkg &>/dev/null - check() { + function check() { ipkg=$(pkg list-installed $lightweightpkg 2> /dev/null | tail -n 1) cpkg=${ipkg%/*} @@ -294,7 +325,7 @@ function fullpackage() { start_spinner "‏‏‎‏‏‎ ‎‏‏‎ ‎📦 $fullpkg" pkg install -y $fullpkg &>/dev/null - check() { + function check() { ipkg=$(pkg list-installed $fullpkg 2> /dev/null | tail -n 1) cpkg=${ipkg%/*} @@ -331,7 +362,7 @@ function zshrepo() { start_spinner "‏‏‎‏‏‎ ‎‏‏‎ ‎📦 oh-my-zsh" git clone git://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh/ &>/dev/null - check() { + function check() { if [[ -d $HOME/.oh-my-zsh ]]; then @@ -362,7 +393,7 @@ function zshrepo() { start_spinner "‏‏‎‏‏‎ ‎‏‏‎ ‎📦 zsh-syntax-highlighting" git clone git://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting &>/dev/null - check() { + function check() { if [[ -d $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting ]]; then @@ -391,7 +422,7 @@ function zshrepo() { start_spinner "‏‏‎‏‏‎ ‎‏‏‎ ‎📦 zsh-autosuggestions" git clone git://github.com/zsh-users/zsh-autosuggestions.git $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions &>/dev/null - check() { + function check() { if [[ -d $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions ]]; then @@ -421,12 +452,12 @@ function shell() { echo -e "\n⚙️ Setting SHELL default" - zsh() { + function zsh() { start_spinner "‏‏‎‏‏‎ ‎‏‏‎ ‎📦 change shell to zsh" sleep 2 - check() { + function check() { if [[ $(which zsh) == "/data/data/com.termux/files/usr/bin/zsh" ]]; then @@ -469,7 +500,7 @@ function owl4cezsh() { sleep 2 cp $DIR/.oh-my-zsh/custom/themes/$owl4cetheme $HOME/.oh-my-zsh/custom/themes/$owl4cetheme - check() { + function check() { if [[ -f $HOME/.oh-my-zsh/custom/themes/$owl4cetheme ]]; then @@ -499,8 +530,10 @@ function neovimplug() { sleep 2 ( + set -e nvim --headless +PlugInstall +qall > /dev/null 2>&1 + ) if [ $? -eq 0 ]; then diff --git a/install.sh b/install.sh index 9e49a74..e05bfdc 100755 --- a/install.sh +++ b/install.sh @@ -24,9 +24,13 @@ if [[ -f $HOME/.xshin.var ]]; then dotfiles if [[ -d $HOME/.config/nvim ]]; then + rm -rf $HOME/.config/nvim + fi + tmuxtheme + welcome permission @@ -41,6 +45,7 @@ if [[ -f $HOME/.xshin.var ]]; then shell owl4cezsh dotfiles + tmuxtheme neovimplug welcome permission