From 601fcd303bf800dbfd6843df9e5093b2cd48ec26 Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Tue, 15 Aug 2023 23:01:09 -0400 Subject: [PATCH 1/9] Getting a new mac setup --- ansible/ansible_hosts.yaml | 2 +- ansible/blue-rock.yaml | 87 ++++++++++++++++++++++++++++++++++++++ link/nix/zshrc | 2 +- 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 ansible/blue-rock.yaml diff --git a/ansible/ansible_hosts.yaml b/ansible/ansible_hosts.yaml index 06c8af2..4ca72c6 100644 --- a/ansible/ansible_hosts.yaml +++ b/ansible/ansible_hosts.yaml @@ -3,7 +3,7 @@ all: hosts: bigboy-wsl: ansible_connection: local - carbonbean: + blue-rock: ansible_connection: local children: servers: diff --git a/ansible/blue-rock.yaml b/ansible/blue-rock.yaml new file mode 100644 index 0000000..87329ee --- /dev/null +++ b/ansible/blue-rock.yaml @@ -0,0 +1,87 @@ +--- +- name: Install packages + hosts: blue-rock + vars: + ansible_python_interpreter: '/usr/bin/python3' + tasks: + - name: Install packages from Homebrew + community.general.homebrew: + state: latest + name: + - adr-tools + # - cdktf + - chart-testing + - dog + - dust + - gh + - gotop + - helm + - hub + - jq + - k9s + - kubectl + - kubectx + - mas + - subversion + - yq + + # - name: Install casks from Homebrew + # community.general.homebrew: + # state: present + # name: + # - homebrew/cask/iterm2 + # - homebrew/cask/meld + # - homebrew/cask/signal + # - homebrew/cask/whatsapp + + # - name: Install apps from App Store + # community.general.mas: + # id: + # - 409183694 # Keynote + # - 413857545 # Divvy + # state: present + + - name: Ensure fonts directory + ansible.builtin.file: + path: "{{ lookup('env', 'HOME') }}/.fonts" + state: directory + + - name: Download Hack Nerd Font + ansible.builtin.unarchive: + src: https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Hack.zip + dest: "{{ lookup('env', 'HOME') }}/.fonts/" + remote_src: true + +# Vim setup + - name: Symlink .vimrc + ansible.builtin.file: + src: "{{ lookup('env', 'HOME') }}/repos/dots/link/nix/vimrc" + dest: "{{ lookup('env', 'HOME') }}/.vimrc" + state: link + force: true + + - name: Install Vundle + ansible.builtin.git: + repo: 'https://github.com/VundleVim/Vundle.vim' + dest: "{{ lookup('env', 'HOME') }}/.vim/bundle/Vundle.vim" + + - name: Install Vundle Plugins + shell: "echo -ne '\n' | vim +PluginInstall! +qall" + +# ZSH setup + - name: Clone my oh-my-zsh plugins + ansible.builtin.git: + repo: 'https://github.com/genebean/my-oh-zsh-plugins' + dest: "{{ lookup('env', 'HOME') }}/repos/customized-oh-my-zsh/plugins" + + - name: Clone my oh-my-zsh themes + ansible.builtin.git: + repo: 'https://github.com/genebean/my-oh-zsh-themes' + dest: "{{ lookup('env', 'HOME') }}/repos/customized-oh-my-zsh/themes" + + - name: Symlink .zshrc + ansible.builtin.file: + src: "{{ lookup('env', 'HOME') }}/repos/dots/link/nix/zshrc" + dest: "{{ lookup('env', 'HOME') }}/.zshrc" + state: link + force: true diff --git a/link/nix/zshrc b/link/nix/zshrc index 14be05d..0114d92 100644 --- a/link/nix/zshrc +++ b/link/nix/zshrc @@ -84,7 +84,7 @@ ZSH_CUSTOM=~/repos/customized-oh-my-zsh # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(brew bundler gem git git-flow github history kube-aliases kube-ps1 kubectl macos pip python terraform vagrant vscode) +plugins=(brew bundler gem git github history kube-ps1 kubectl macos pip python terraform vagrant vscode) source $ZSH/oh-my-zsh.sh From 70ae1cd6b3951249a68a1314d73f6b51454826ee Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Wed, 16 Aug 2023 20:49:07 -0400 Subject: [PATCH 2/9] More updates --- ansible/blue-rock.yaml | 49 +++++++++++++++++++++++++++++++------- link/mac/vimrc_os_specific | 4 ---- link/nix/vimrc | 4 +--- link/nix/zshrc | 8 +++---- 4 files changed, 45 insertions(+), 20 deletions(-) delete mode 100644 link/mac/vimrc_os_specific diff --git a/ansible/blue-rock.yaml b/ansible/blue-rock.yaml index 87329ee..3f2f30b 100644 --- a/ansible/blue-rock.yaml +++ b/ansible/blue-rock.yaml @@ -2,7 +2,7 @@ - name: Install packages hosts: blue-rock vars: - ansible_python_interpreter: '/usr/bin/python3' + ansible_python_interpreter: '/usr/local/bin/python3' tasks: - name: Install packages from Homebrew community.general.homebrew: @@ -11,6 +11,7 @@ - adr-tools # - cdktf - chart-testing + - coreutils - dog - dust - gh @@ -22,34 +23,57 @@ - kubectl - kubectx - mas + - python - subversion + - wget - yq # - name: Install casks from Homebrew # community.general.homebrew: # state: present # name: + # - homebrew/cask/1password + # - homebrew/cask/cakebrew + # - homebrew/cask/elgato-stream-deck + # - homebrew/cask/firefox + # - homebrew/cask/google-drive # - homebrew/cask/iterm2 + # - homebrew/cask/keepingyouawake + # - homebrew/cask/logseq # - homebrew/cask/meld + # - homebrew/cask/obs # - homebrew/cask/signal + # - homebrew/cask/slack + # - homebrew/cask/thunderbird + # - homebrew/cask/visual-studio-code # - homebrew/cask/whatsapp + # - homebrew/cask/zoom + # - homebrew/cask-fonts/font-hack-nerd-font + # - homebrew/cask-fonts/font-inconsolata-g-for-powerline + # - homebrew/cask-fonts/font-source-code-pro-for-powerline + # - puppetlabs/puppet/pdk # - name: Install apps from App Store # community.general.mas: - # id: - # - 409183694 # Keynote - # - 413857545 # Divvy # state: present + # id: + # - 1569813296 # 1Password for Safari + # - 417375580 # BetterSnapTool + # - 1532419400 # MeetingBar for Meet, Zoom & Co + # - 1451685025 # WireGuard - - name: Ensure fonts directory - ansible.builtin.file: - path: "{{ lookup('env', 'HOME') }}/.fonts" - state: directory + - name: Install packages with pip + ansible.builtin.pip: + name: + - ansible + - ansible-lint + # - powerline-status # repalced with airline + # - psutil - name: Download Hack Nerd Font ansible.builtin.unarchive: src: https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Hack.zip - dest: "{{ lookup('env', 'HOME') }}/.fonts/" + dest: "{{ lookup('env', 'HOME') }}/Library/Fonts/" remote_src: true # Vim setup @@ -60,6 +84,13 @@ state: link force: true + # - name: Symlink .vimrc_os_specific + # ansible.builtin.file: + # src: "{{ lookup('env', 'HOME') }}/repos/dots/link/mac/vimrc_os_specific" + # dest: "{{ lookup('env', 'HOME') }}/.vimrc_os_specific" + # state: link + # force: true + - name: Install Vundle ansible.builtin.git: repo: 'https://github.com/VundleVim/Vundle.vim' diff --git a/link/mac/vimrc_os_specific b/link/mac/vimrc_os_specific deleted file mode 100644 index 5f3fee6..0000000 --- a/link/mac/vimrc_os_specific +++ /dev/null @@ -1,4 +0,0 @@ -" enable powerline -python3 from powerline.vim import setup as powerline_setup -python3 powerline_setup() -python3 del powerline_setup diff --git a/link/nix/vimrc b/link/nix/vimrc index 4fad9c2..83c51ae 100644 --- a/link/nix/vimrc +++ b/link/nix/vimrc @@ -75,6 +75,4 @@ let g:vim_markdown_folding_disabled = 1 " settings for vim-airline let g:airline_theme='powerlineish' -" import settings that are OS specific -" source ~/.vimrc_os_specific - +" let g:airline_powerline_fonts = 1 diff --git a/link/nix/zshrc b/link/nix/zshrc index 0114d92..2f252cc 100644 --- a/link/nix/zshrc +++ b/link/nix/zshrc @@ -99,9 +99,9 @@ if [[ $(uname) == 'Darwin' ]]; then export PATH=/usr/local/MacGPG2/bin:$PATH fi -export GPG_TTY=$(tty) -export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) -gpgconf --launch gpg-agent +# export GPG_TTY=$(tty) +# export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) +# gpgconf --launch gpg-agent # export MANPATH="/usr/local/man:$MANPATH" @@ -202,7 +202,7 @@ if [[ `uname` == 'Darwin' ]]; then export PATH=$PATH:$GEMBIN # added by travis gem - [ -f ~/.travis/travis.sh ] && source ~/.travis/travis.sh || echo 'The travis gem is missing. After installing it run "echo y|travis" to create ~/.travis' + # [ -f ~/.travis/travis.sh ] && source ~/.travis/travis.sh || echo 'The travis gem is missing. After installing it run "echo y|travis" to create ~/.travis' # added to make pipx work [ -d /Users/gene/.local/bin ] && export PATH=$PATH:/Users/gene/.local/bin From 919c18f69ecaa5b7e77a2cce25551a343e656590 Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Wed, 16 Aug 2023 21:46:10 -0400 Subject: [PATCH 3/9] More bits --- ansible/blue-rock.yaml | 5 +++++ link/nix/zshrc | 45 +++++++++++++++++++++++++++++------------- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/ansible/blue-rock.yaml b/ansible/blue-rock.yaml index 3f2f30b..136a7c3 100644 --- a/ansible/blue-rock.yaml +++ b/ansible/blue-rock.yaml @@ -105,6 +105,11 @@ repo: 'https://github.com/genebean/my-oh-zsh-plugins' dest: "{{ lookup('env', 'HOME') }}/repos/customized-oh-my-zsh/plugins" + - name: Clone zsh-autosuggestions + ansible.builtin.git: + repo: 'https://github.com/zsh-users/zsh-autosuggestions' + dest: "{{ lookup('env', 'HOME') }}/repos/customized-oh-my-zsh/plugins/zsh-autosuggestions" + - name: Clone my oh-my-zsh themes ansible.builtin.git: repo: 'https://github.com/genebean/my-oh-zsh-themes' diff --git a/link/nix/zshrc b/link/nix/zshrc index 2f252cc..b08d9d1 100644 --- a/link/nix/zshrc +++ b/link/nix/zshrc @@ -84,7 +84,7 @@ ZSH_CUSTOM=~/repos/customized-oh-my-zsh # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(brew bundler gem git github history kube-ps1 kubectl macos pip python terraform vagrant vscode) +plugins=(brew bundler gem git github history kube-ps1 kubectl macos pip python terraform vagrant vscode zsh-autosuggestions) source $ZSH/oh-my-zsh.sh @@ -99,7 +99,7 @@ if [[ $(uname) == 'Darwin' ]]; then export PATH=/usr/local/MacGPG2/bin:$PATH fi -# export GPG_TTY=$(tty) +export GPG_TTY=$(tty) # export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) # gpgconf --launch gpg-agent @@ -122,10 +122,12 @@ alias gbc='git branch --merged | command grep -vE "^(\*|\s*(main|master|develop| alias gitextract='git log --pretty=email --patch-with-stat --reverse --full-index --binary --' alias gpge='gpg2 --encrypt --sign --armor -r ' alias hubpr='hub pull-request --push --browse' -alias pssh='ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i ~/.ssh/id_rsa-acceptance' +alias pssh='ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -o PubkeyAcceptedKeyTypes=+ssh-rsa -o HostKeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group1-sha1 -i ~/.ssh/id_rsa-acceptance' alias sal='ssh-add -L' alias st='open -a SourceTree' alias sz='source ~/.zshrc' +alias usegpg='killall ssh-agent; export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) && gpgconf --launch gpg-agent' +alias usessh='gpgconf --kill gpg-agent' # aliases whose command changes based on OS if [[ `uname` == 'Linux' ]]; then @@ -139,8 +141,33 @@ if [[ `uname` == 'Linux' ]]; then alias enable-ruby-27='source ~/enable-ruby-27' alias pbcopy='xclip -selection clipboard' alias pbpaste='xclip -selection clipboard -o' + alias uwgconnect='nmcli dev wifi connect SecureWest password' alias uwgroute='nmcli connection modify SecureWest ipv4.route-metric 20; nmcli radio wifi off; nmcli radio wifi on' alias uwgforget='nmcli connection delete SecureWest' + + function popup() { + echo 'checking for updates via apt...' + sudo apt update + sudo apt upgrade -y + echo + echo 'checking for updates via flatpak...' + flatpak update + echo + echo 'checking for updates via snap...' + sudo snap refresh + echo + echo 'checking for updates via brew...' + brew update + brew upgrade + echo + echo 'checking for updates to Zoom' + wget -O /tmp/zoom_amd64.deb https://zoom.us/client/latest/zoom_amd64.deb && sudo apt-get install -y /tmp/zoom_amd64.deb; rm -f /tmp/zoom_amd64.deb + echo + echo 'checking for firmware updates...' + sudo fwupdmgr refresh --force && sudo fwupdmgr get-updates && sudo fwupdmgr update + echo + echo 'all done :)' + } fi if [[ `uname` != 'Linux' ]]; then @@ -152,16 +179,6 @@ if [[ `uname` != 'Linux' ]]; then } fi -# helper for aws and assume-role -function awsrole() { - echo "Enter MFA token:" - read mfatoken - eval $(assume-role $1 $AWS_HELPER_USERNAME $mfatoken) -} - -function aws_account_info { -[ "$AWS_ACCOUNT_NAME" ] && [ "$AWS_ACCOUNT_ROLE" ] && echo "%{$reset_color%}%{$fg[blue]%}aws:(%{$reset_color%}%{$fg[red]%}$AWS_ACCOUNT_NAME:$AWS_ACCOUNT_ROLE%{$fg[blue]%})%{$reset_color%}" -} # )ofni_tnuocca_swa($ is $(aws_account_info) backwards #PROMPT=`echo $PROMPT | rev | sed 's/ / )ofni_tnuocca_swa($ /'| rev` @@ -250,7 +267,7 @@ elif [[ `uname` == 'Linux' ]]; then if [ -d "$HOME/.pulumi/bin" ] ; then PATH=$PATH:$HOME/.pulumi/bin fi - + if [ -d "$HOME/.local/share/gem/ruby/3.0.0/bin" ] ; then PATH="$HOME/.local/share/gem/ruby/3.0.0/bin:$PATH" fi From d3a33ae73ea04e0bf7a0f25e4d15c423d6d4609d Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Thu, 17 Aug 2023 21:47:01 -0400 Subject: [PATCH 4/9] Get vim working fairly well --- link/nix/vimrc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/link/nix/vimrc b/link/nix/vimrc index 83c51ae..99daf45 100644 --- a/link/nix/vimrc +++ b/link/nix/vimrc @@ -1,4 +1,5 @@ -filetype off " required by Vundle. filetype is reenabled after Vundle starts +set nocompatible " be iMproved, required +filetype off " required by Vundle. filetype is reenabled after Vundle starts " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim @@ -15,8 +16,10 @@ Plugin 'godlygeek/tabular' " provides a method for lining things Plugin 'honza/vim-snippets' " provides snippets for use with vim-snipmate Plugin 'MarcWeber/vim-addon-mw-utils' " a utility used by vim-snipmate Plugin 'mrk21/yaml-vim' " provides indentation and syntax highlighting for yaml +Plugin 'rbong/vim-flog' " git branch viewer built on fugitive Plugin 'rodjek/vim-puppet' " provides several niceties for working with Puppet Plugin 'tomtom/tlib_vim' " a utility used by vim-snipmate +Plugin 'tpope/vim-fugitive' " all things Git here in Vim Plugin 'vim-airline/vim-airline' " status line alternative to powerline Plugin 'vim-airline/vim-airline-themes' " themes for vim-airline Plugin 'vim-ruby/vim-ruby' " provides syntax highlighting for ruby files @@ -34,10 +37,11 @@ filetype plugin indent on " required for plugins to be able to adjust indent " " see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line -syntax on " enable syntax highlighting +syntax on " enable syntax highlighting set encoding=utf-8 set termencoding=utf-8 +set t_Co=256 " tell vim we have 256 colors to work with set autoindent " automatically indent new lines set background=dark " tell vim your terminal has a dark background @@ -47,13 +51,13 @@ set fillchars+=stl:\ ,stlnc:\ " fix added per powerline troubles set laststatus=2 " Always display the status line in all windows set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the status line) set smarttab " helps with expanding tabs to spaces (I think) +set statusline+=%{FugitiveStatusline()} " get git info via fugitive plugin set statusline+=%#warningmsg# " recommended setting from syntastic plugin set statusline+=%{SyntasticStatuslineFlag()} " recommended setting from syntastic plugin set statusline+=%* " recommended setting from syntastic plugin -set t_Co=256 " tell vim we have 256 colors to work with -let g:solarized_termtrans = 1 " This gets rid of the grey background -colorscheme solarized " use the solorized set of colors +"let g:solarized_termtrans = 1 " This gets rid of the grey background +"colorscheme solarized " use the solorized set of colors " This has to come after colorscheme to not be masked highlight ColorColumn ctermbg=232 " set the color to be used for guidelines @@ -74,5 +78,6 @@ let g:syntastic_quiet_messages = {'level': 'warnings'} let g:vim_markdown_folding_disabled = 1 " settings for vim-airline -let g:airline_theme='powerlineish' -" let g:airline_powerline_fonts = 1 +let g:airline_theme='badwolf' +let g:airline_powerline_fonts = 1 + From 1e6c8802c037d1f4a8820496f0035bb1b23b8a81 Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Thu, 17 Aug 2023 21:50:20 -0400 Subject: [PATCH 5/9] Remove solarized stuff I now prefer my terminal colors to be used within vim --- link/nix/vimrc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/link/nix/vimrc b/link/nix/vimrc index 99daf45..4738d06 100644 --- a/link/nix/vimrc +++ b/link/nix/vimrc @@ -8,7 +8,6 @@ call vundle#begin() " let Vundle manage Vundle, required for Vundle to work right Plugin 'VundleVim/Vundle.vim' -Plugin 'altercation/vim-colors-solarized' " provides solorized color scheme Plugin 'ekalinin/Dockerfile.vim' " provides syntax highlighting for Dockerfiles Plugin 'elzr/vim-json' " provides syntax highlighting for JSON files Plugin 'garbas/vim-snipmate' " provides code snippets @@ -56,10 +55,7 @@ set statusline+=%#warningmsg# " recommended setting from syntast set statusline+=%{SyntasticStatuslineFlag()} " recommended setting from syntastic plugin set statusline+=%* " recommended setting from syntastic plugin -"let g:solarized_termtrans = 1 " This gets rid of the grey background -"colorscheme solarized " use the solorized set of colors - -" This has to come after colorscheme to not be masked +" This has to come after colorscheme, if defined, to not be masked highlight ColorColumn ctermbg=232 " set the color to be used for guidelines let &colorcolumn=join(range(81,999),",") " change the background color of everything beyond 80 characters From d4fca873d96a97067b7651cd70856c04697f2bd2 Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Thu, 17 Aug 2023 21:53:34 -0400 Subject: [PATCH 6/9] Ignore .vscode folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 13204f3..68af054 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /.vagrant/ +/.vscode/ /vendor/ .dccache From d064f77099020339366613fe6477a8e69b743cc7 Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Thu, 17 Aug 2023 21:53:47 -0400 Subject: [PATCH 7/9] Add more packages to homebrew list --- ansible/blue-rock.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ansible/blue-rock.yaml b/ansible/blue-rock.yaml index 136a7c3..115a4a6 100644 --- a/ansible/blue-rock.yaml +++ b/ansible/blue-rock.yaml @@ -23,8 +23,11 @@ - kubectl - kubectx - mas + - neovim + - npm - python - subversion + - tree - wget - yq From 835cf4d23632cf9bbe2d2ccb094458a9a9746d9e Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Tue, 22 Aug 2023 08:17:32 -0400 Subject: [PATCH 8/9] Add Vivaldi and update aliases --- ansible/blue-rock.yaml | 1 + link/nix/zshrc | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ansible/blue-rock.yaml b/ansible/blue-rock.yaml index 115a4a6..fecb5ff 100644 --- a/ansible/blue-rock.yaml +++ b/ansible/blue-rock.yaml @@ -49,6 +49,7 @@ # - homebrew/cask/slack # - homebrew/cask/thunderbird # - homebrew/cask/visual-studio-code + # - homebrew/cask/vivaldi # - homebrew/cask/whatsapp # - homebrew/cask/zoom # - homebrew/cask-fonts/font-hack-nerd-font diff --git a/link/nix/zshrc b/link/nix/zshrc index b08d9d1..b493f56 100644 --- a/link/nix/zshrc +++ b/link/nix/zshrc @@ -131,8 +131,13 @@ alias usessh='gpgconf --kill gpg-agent' # aliases whose command changes based on OS if [[ `uname` == 'Linux' ]]; then + alias uwgconnect='nmcli dev wifi connect SecureWest password' + alias uwgforget='nmcli connection delete SecureWest' alias ykey='sudo systemctl restart pcscd && sudo pkill -9 gpg-agent && source ~/.zshrc; ssh-add -L' else + alias currentwifi='networksetup -getairportnetwork en0 |cut -d ":" -f2- | cut -d " " -f2-' + alias uwgconnect='networksetup -setairportnetwork en0 SecureWest' + alias uwgforget='networksetup -removepreferredwirelessnetwork en0 SecureWest' alias ykey='pkill -9 gpg-agent && source ~/.zshrc; ssh-add -L' fi @@ -141,9 +146,6 @@ if [[ `uname` == 'Linux' ]]; then alias enable-ruby-27='source ~/enable-ruby-27' alias pbcopy='xclip -selection clipboard' alias pbpaste='xclip -selection clipboard -o' - alias uwgconnect='nmcli dev wifi connect SecureWest password' - alias uwgroute='nmcli connection modify SecureWest ipv4.route-metric 20; nmcli radio wifi off; nmcli radio wifi on' - alias uwgforget='nmcli connection delete SecureWest' function popup() { echo 'checking for updates via apt...' From 1cf47f814d0914b0a87dc4de82669713a106091c Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Wed, 23 Aug 2023 01:28:00 -0400 Subject: [PATCH 9/9] Use oh-my-posh for theme, cleanup --- link/nix/zshrc | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/link/nix/zshrc b/link/nix/zshrc index b493f56..b1cfb1d 100644 --- a/link/nix/zshrc +++ b/link/nix/zshrc @@ -4,15 +4,9 @@ export ZSH=~/.oh-my-zsh # Set name of the theme to load. Optionally, if you set this to "random" # it'll load a random theme each time that oh-my-zsh is loaded. # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes -if [[ `uname` == 'Linux' ]]; then - ZSH_THEME="beanbag" - #ZSH_THEME="af-magic" -else - ZSH_THEME="beanbag" - #ZSH_THEME="robbyrussell" - #ZSH_THEME="pygmalion" - #ZSH_THEME="muse" -fi +#ZSH_THEME="robbyrussell" + +# use oh-my-posh for theme # Get Homebrew into the path early so that plugins and such can use # programs installed by it @@ -84,7 +78,7 @@ ZSH_CUSTOM=~/repos/customized-oh-my-zsh # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(brew bundler gem git github history kube-ps1 kubectl macos pip python terraform vagrant vscode zsh-autosuggestions) +plugins=(bundler gem git github history kubectl macos pip terraform vagrant vscode zsh-autosuggestions) source $ZSH/oh-my-zsh.sh @@ -181,16 +175,6 @@ if [[ `uname` != 'Linux' ]]; then } fi -# )ofni_tnuocca_swa($ is $(aws_account_info) backwards -#PROMPT=`echo $PROMPT | rev | sed 's/ / )ofni_tnuocca_swa($ /'| rev` - -function get_cluster_short() { - echo "$1" |rev |cut -d _ -f1 |rev -} -KUBE_PS1_CLUSTER_FUNCTION=get_cluster_short -KUBE_PS1_COLOR_CONTEXT="%{$fg[yellow]%}" -KUBE_PS1_ENABLED=false - export EDITOR='vim' export GOPATH=$HOME/go @@ -220,9 +204,6 @@ if [[ `uname` == 'Darwin' ]]; then GEMBIN="$(gem environment gemdir)/bin" export PATH=$PATH:$GEMBIN - # added by travis gem - # [ -f ~/.travis/travis.sh ] && source ~/.travis/travis.sh || echo 'The travis gem is missing. After installing it run "echo y|travis" to create ~/.travis' - # added to make pipx work [ -d /Users/gene/.local/bin ] && export PATH=$PATH:/Users/gene/.local/bin @@ -284,7 +265,5 @@ if type floaty &>/dev/null; then source $(floaty completion --shell zsh) fi -# default kube-ps1 to off -kubeoff - +eval "$(oh-my-posh init zsh --config ~/repos/my-oh-my-posh-themes/beanbag.omp.json)"