- update upgrade_system to better support arch and have better error
handling - use dracula for vim, will change - use rootless docker socket if available
This commit is contained in:
parent
dfe35df892
commit
307e957a52
3 changed files with 61 additions and 59 deletions
|
@ -28,6 +28,7 @@ else
|
||||||
endif
|
endif
|
||||||
let g:deoplete#enable_at_startup = 1
|
let g:deoplete#enable_at_startup = 1
|
||||||
|
|
||||||
|
Plug 'dracula/vim', { 'as': 'dracula' }
|
||||||
Plug 'Chiel92/vim-autoformat'
|
Plug 'Chiel92/vim-autoformat'
|
||||||
Plug 'Lokaltog/vim-easymotion'
|
Plug 'Lokaltog/vim-easymotion'
|
||||||
Plug 'airblade/vim-gitgutter'
|
Plug 'airblade/vim-gitgutter'
|
||||||
|
@ -38,7 +39,6 @@ Plug 'godlygeek/tabular'
|
||||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
|
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
|
||||||
Plug 'majutsushi/tagbar'
|
Plug 'majutsushi/tagbar'
|
||||||
Plug 'moll/vim-bbye'
|
Plug 'moll/vim-bbye'
|
||||||
Plug 'nanotech/jellybeans.vim'
|
|
||||||
Plug 'rking/ag.vim'
|
Plug 'rking/ag.vim'
|
||||||
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
|
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
|
||||||
Plug 'scrooloose/nerdcommenter'
|
Plug 'scrooloose/nerdcommenter'
|
||||||
|
@ -59,7 +59,7 @@ if executable('ag')
|
||||||
let $FZF_DEFAULT_COMMAND = 'ag --skip-vcs-ignores --nocolor -g "" -l'
|
let $FZF_DEFAULT_COMMAND = 'ag --skip-vcs-ignores --nocolor -g "" -l'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
colorscheme jellybeans " Color scheme
|
colorscheme dracula " Color scheme
|
||||||
set laststatus=2 " Enable airline
|
set laststatus=2 " Enable airline
|
||||||
let g:airline_theme = 'jellybeans' " Airline color scheme
|
let g:airline_theme = 'jellybeans' " Airline color scheme
|
||||||
let g:airline#extensions#tabline#enabled = 1 " Enable tab list in airline
|
let g:airline#extensions#tabline#enabled = 1 " Enable tab list in airline
|
||||||
|
|
|
@ -102,6 +102,11 @@ fi
|
||||||
|
|
||||||
alias mv='mv -i'
|
alias mv='mv -i'
|
||||||
|
|
||||||
|
# if rootless docker has a unix domain socket, use it!
|
||||||
|
if [ -e "${XDG_RUNTIME_DIR}/docker.sock" ]; then
|
||||||
|
export DOCKER_HOST="unix://${XDG_RUNTIME_DIR}/docker.sock"
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v docker-compose &> /dev/null; then
|
if command -v docker-compose &> /dev/null; then
|
||||||
alias dco='docker-compose'
|
alias dco='docker-compose'
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,72 +1,69 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
upgrade_system() {
|
upgrade_system() {
|
||||||
case "$(uname | tr '[:upper:]' '[:lower:]')" in
|
|
||||||
'darwin')
|
|
||||||
if command -v brew &> /dev/null; then
|
|
||||||
brew update || return $?
|
|
||||||
brew upgrade || return $?
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
'linux')
|
|
||||||
# Debian/Ubuntu
|
|
||||||
if command -v apt &> /dev/null; then
|
|
||||||
sudo sh -c 'apt update && apt upgrade' || return $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Fedora
|
|
||||||
if command -v dnf &> /dev/null; then
|
|
||||||
sudo dnf upgrade || return $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Arch
|
|
||||||
if command -v yay &> /dev/null; then
|
|
||||||
yay -Syu || return $?
|
|
||||||
elif command -v pacman &> /dev/null; then
|
|
||||||
sudo pacman -Syu || return $?
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if command -v vim &> /dev/null; then
|
|
||||||
vim -c 'PlugUpgrade | q' || return $?
|
|
||||||
vim -c 'PlugUpdate | sleep 3 | qa' || return $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
(
|
(
|
||||||
set -e
|
set -euo pipefail
|
||||||
|
|
||||||
cd "${ZSH}/custom/plugins"
|
case "$(uname | tr '[:upper:]' '[:lower:]')" in
|
||||||
|
'darwin')
|
||||||
|
if command -v brew &> /dev/null; then
|
||||||
|
brew update
|
||||||
|
brew upgrade
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
for FILE in *; do
|
'linux')
|
||||||
if ! [ -d "${FILE}" ]; then
|
# Debian/Ubuntu
|
||||||
continue
|
if command -v apt &> /dev/null; then
|
||||||
fi
|
sudo sh -c 'apt update && apt upgrade'
|
||||||
|
fi
|
||||||
|
|
||||||
(
|
# Fedora
|
||||||
cd "${FILE}"
|
if command -v dnf &> /dev/null; then
|
||||||
[ -d .git ] || exit 0
|
sudo dnf upgrade
|
||||||
git pull
|
fi
|
||||||
)
|
|
||||||
done
|
|
||||||
) || return $?
|
|
||||||
|
|
||||||
(
|
# Arch
|
||||||
set -e
|
if command -v yay &> /dev/null; then
|
||||||
|
yay -Syu --devel --timeupdate
|
||||||
|
elif command -v pacman &> /dev/null; then
|
||||||
|
sudo pacman -Syu
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
cd "${HOME}/.tmux"
|
if command -v vim &> /dev/null; then
|
||||||
git pull
|
vim -c 'PlugUpgrade | q'
|
||||||
if [ -n "${TMUX}" ]; then
|
vim -c 'PlugUpdate | sleep 3 | qa'
|
||||||
tmux source-file "${HOME}/.tmux.conf"
|
|
||||||
fi
|
fi
|
||||||
)
|
|
||||||
|
|
||||||
if command -v fwupdmgr &> /dev/null; then
|
|
||||||
(
|
(
|
||||||
set -e
|
cd "${ZSH}/custom/plugins"
|
||||||
|
|
||||||
|
for FILE in *; do
|
||||||
|
if ! [ -d "${FILE}" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
cd "${FILE}"
|
||||||
|
[ -d .git ] || exit 0
|
||||||
|
git pull
|
||||||
|
)
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
|
(
|
||||||
|
cd "${HOME}/.tmux"
|
||||||
|
git pull
|
||||||
|
if [ -n "${TMUX:-}" ]; then
|
||||||
|
tmux source-file "${HOME}/.tmux.conf"
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
|
||||||
|
if command -v fwupdmgr &> /dev/null; then
|
||||||
fwupdmgr refresh
|
fwupdmgr refresh
|
||||||
fwupdmgr upgrade
|
fwupdmgr upgrade
|
||||||
)
|
fi
|
||||||
fi
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue