From 307e957a52c547731652064c33903d93b2aa3966 Mon Sep 17 00:00:00 2001 From: Tony Blyler Date: Sat, 1 May 2021 18:45:32 -0400 Subject: [PATCH] - update upgrade_system to better support arch and have better error handling - use dracula for vim, will change - use rootless docker socket if available --- home/.config/nvim/init.vim | 4 +- home/.zshrc | 5 ++ home/.zshrc.d/upgrade_system.sh | 111 ++++++++++++++++---------------- 3 files changed, 61 insertions(+), 59 deletions(-) diff --git a/home/.config/nvim/init.vim b/home/.config/nvim/init.vim index 84f76f6..bbee1a4 100644 --- a/home/.config/nvim/init.vim +++ b/home/.config/nvim/init.vim @@ -28,6 +28,7 @@ else endif let g:deoplete#enable_at_startup = 1 +Plug 'dracula/vim', { 'as': 'dracula' } Plug 'Chiel92/vim-autoformat' Plug 'Lokaltog/vim-easymotion' Plug 'airblade/vim-gitgutter' @@ -38,7 +39,6 @@ Plug 'godlygeek/tabular' Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } Plug 'majutsushi/tagbar' Plug 'moll/vim-bbye' -Plug 'nanotech/jellybeans.vim' Plug 'rking/ag.vim' Plug 'rust-lang/rust.vim', { 'for': 'rust' } Plug 'scrooloose/nerdcommenter' @@ -59,7 +59,7 @@ if executable('ag') let $FZF_DEFAULT_COMMAND = 'ag --skip-vcs-ignores --nocolor -g "" -l' endif -colorscheme jellybeans " Color scheme +colorscheme dracula " Color scheme set laststatus=2 " Enable airline let g:airline_theme = 'jellybeans' " Airline color scheme let g:airline#extensions#tabline#enabled = 1 " Enable tab list in airline diff --git a/home/.zshrc b/home/.zshrc index 4c6fe0e..288f629 100644 --- a/home/.zshrc +++ b/home/.zshrc @@ -102,6 +102,11 @@ fi 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 alias dco='docker-compose' fi diff --git a/home/.zshrc.d/upgrade_system.sh b/home/.zshrc.d/upgrade_system.sh index 8a78a02..50de840 100755 --- a/home/.zshrc.d/upgrade_system.sh +++ b/home/.zshrc.d/upgrade_system.sh @@ -1,72 +1,69 @@ #!/bin/bash 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 - if ! [ -d "${FILE}" ]; then - continue - fi + 'linux') + # Debian/Ubuntu + if command -v apt &> /dev/null; then + sudo sh -c 'apt update && apt upgrade' + fi - ( - cd "${FILE}" - [ -d .git ] || exit 0 - git pull - ) - done - ) || return $? + # Fedora + if command -v dnf &> /dev/null; then + sudo dnf upgrade + fi - ( - set -e + # Arch + 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" - git pull - if [ -n "${TMUX}" ]; then - tmux source-file "${HOME}/.tmux.conf" + if command -v vim &> /dev/null; then + vim -c 'PlugUpgrade | q' + vim -c 'PlugUpdate | sleep 3 | qa' 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 upgrade - ) - fi + fi + ) }