From 7d9cee455ac7aaac8bd9307d35c1a3de9757e3cd Mon Sep 17 00:00:00 2001 From: Daniel de Cloet Date: Tue, 8 Feb 2022 19:33:57 +0100 Subject: [PATCH] Setup configuration for alacritty and zsh for macos --- templates/alacritty.yml | 8 +++++++- templates/zshrc | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/templates/alacritty.yml b/templates/alacritty.yml index 1f9c57a..17544fb 100644 --- a/templates/alacritty.yml +++ b/templates/alacritty.yml @@ -118,7 +118,11 @@ font: # - (macOS) Menlo # - (Linux/BSD) monospace # - (Windows) Consolas +{% if platform == "macos" %} + family: Menlo +{% else %} family: Source Code Pro +{% endif %} # The `style` can be specified to pick a specific face. style: Regular @@ -157,7 +161,9 @@ font: style: Bold Italic # Point size - #size: 11.0 +{% if device == "macbook" %} + size: 14.0 +{% endif %} # Offset is the extra space around each character. `offset.y` can be thought # of as modifying the line spacing, and `offset.x` as modifying the letter diff --git a/templates/zshrc b/templates/zshrc index 36b3c96..8f903c0 100644 --- a/templates/zshrc +++ b/templates/zshrc @@ -3,7 +3,11 @@ # export PATH=$HOME/bin:/usr/local/bin:$PATH # Path to your oh-my-zsh installation. +{% if platform == "macos" %} +export ZSH="$HOME/.oh-my-zsh" +{% else %} ZSH=/usr/share/oh-my-zsh/ +{% endif %} # Set name of the theme to load --- if set to "random", it will # load a random theme each time oh-my-zsh is loaded, in which case, @@ -60,6 +64,15 @@ function precmd() { # Case-sensitive completion must be off. _ and - will be interchangeable. # HYPHEN_INSENSITIVE="true" +{% if platform == "macos" %} +# Uncomment one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 +{% else %} # Uncomment the following line to disable bi-weekly auto-update checks. DISABLE_AUTO_UPDATE="true" @@ -68,6 +81,7 @@ DISABLE_AUTO_UPDATE="true" # Uncomment the following line to change how often to auto-update (in days). # export UPDATE_ZSH_DAYS=13 +{% endif %} # Uncomment the following line if pasting URLs and other text is messed up. # DISABLE_MAGIC_FUNCTIONS="true" @@ -180,14 +194,35 @@ function fuck { sudo ${history[@][1]} } +{% if platform == "linux" %} export SUDO_ASKPASS=~/bin/askpass-rofi +{% endif %} export EDITOR="nvim" +{% if platform == "macos" %} +export PATH="/usr/local/bin:$PATH" +{% endif %} export PATH="$PATH:/home/daniel/.yarn/bin" +{% if device == "laptop" or device == "desktop" %} export KUBECONFIG=~/.kube/k3s-mcintyre.yaml +{% endif %} +{% if platform == "linux" %} export LC_ALL="en_US.UTF-8" +{% endif %} autoload -U +X bashcompinit && bashcompinit +{% if platform == "linux" %} complete -o nospace -C /usr/bin/terraform terraform +{% elif platform == "macos" %} +complete -o nospace -C /usr/local/bin/terraform terraform +{% endif %} + +{% if device == "macbook" %} +# The next line updates PATH for the Google Cloud SDK. +if [ -f '/Users/daniel.de.cloet/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/daniel.de.cloet/google-cloud-sdk/path.zsh.inc'; fi + +# The next line enables shell command completion for gcloud. +if [ -f '/Users/daniel.de.cloet/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/daniel.de.cloet/google-cloud-sdk/completion.zsh.inc'; fi +{% endif %} fortune -s