From a13ecc9e4ddf718594701210dc774adee35b19e8 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 22 Jan 2022 09:11:53 -0800 Subject: [PATCH] [zsh] Convert all shell-log calls to ShellLog --- zprofile | 4 ++-- zsh/func/darwin_configure_screenshots_directory | 4 ++-- zsh/func/darwin_init_once | 4 ++-- zsh/func/init_env | 2 +- zsh/func/init_env_darwin | 2 +- zsh/func/init_rc_aliases | 4 ++-- zsh/func/init_rc_configure_completion | 2 +- zsh/func/init_rc_configure_ls | 6 +++--- zsh/func/init_rc_configure_prompt | 4 ++-- zsh/func/init_rc_configure_zle | 4 ++-- zsh/func/init_rc_darwin | 2 +- zsh/func/init_rc_linux | 2 +- zsh/func/init_zsh_functions | 4 ++-- zsh/func/init_zsh_history | 2 +- zsh/func/init_zsh_options | 2 +- zsh/func/load_module | 6 +++--- zshrc | 2 +- 17 files changed, 28 insertions(+), 28 deletions(-) diff --git a/zprofile b/zprofile index 0646044..ac38f72 100644 --- a/zprofile +++ b/zprofile @@ -1,11 +1,11 @@ #!/usr/bin/env zsh # Eryn Wells -shell-log 'Initializing Login Environment' +ShellLog 'Initializing Login Environment' # Start SSH agent for password-less logins if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then - print_info -l 1 'Starting ssh-agent' + ShellLog 'Starting ssh-agent' eval `ssh-agent -s` trap "kill $SSH_AGENT_PID" 0 fi diff --git a/zsh/func/darwin_configure_screenshots_directory b/zsh/func/darwin_configure_screenshots_directory index cee8b09..84b93f7 100644 --- a/zsh/func/darwin_configure_screenshots_directory +++ b/zsh/func/darwin_configure_screenshots_directory @@ -7,14 +7,14 @@ function darwin_configure_screenshots_directory { icloud=`darwin_icloud_drive_path` if [[ ! -d "$icloud" ]]; then - shell-log -l error "iCloud directory doesn't exist: $icloud" + ShellLog -l error "iCloud directory doesn't exist: $icloud" return 1 fi # Put screenshots in iCloud Drive, in a directory according to hostname local name=`hostname -s | tr A-Z a-z` local screenshots_dir="$icloud/Screenshots/$name" - shell-log "Setting screenshot directory: $screenshots_dir" + ShellLog "Setting screenshot directory: $screenshots_dir" mkdir -p "$screenshots_dir" defaults write com.apple.screencapture screenshots_diration "$screenshots_dir" diff --git a/zsh/func/darwin_init_once b/zsh/func/darwin_init_once index c0259ed..be3a868 100644 --- a/zsh/func/darwin_init_once +++ b/zsh/func/darwin_init_once @@ -7,14 +7,14 @@ autoload darwin_configure_screenshots_directory function darwin_init_once { # Dim dock icons of apps that have been hidden. - shell-log "Auto-hiding Dock" + ShellLog "Auto-hiding Dock" defaults write com.apple.Dock showhidden -boolean yes killall Dock darwin_configure_screenshots_directory # See https://techstuffer.com/this-app-is-damaged-error-macos-sierra/ - shell-log "Disabling overly restrictive Gatekeeper" + ShellLog "Disabling overly restrictive Gatekeeper" sudo spctl --master-disable } diff --git a/zsh/func/init_env b/zsh/func/init_env index c3d576f..e4b1dba 100644 --- a/zsh/func/init_env +++ b/zsh/func/init_env @@ -4,7 +4,7 @@ function init_env { - shell-log 'Initializing basic environment' + ShellLog 'Initializing basic environment' export PAGER="less" export MANPAGER=$PAGER diff --git a/zsh/func/init_env_darwin b/zsh/func/init_env_darwin index e7448b1..7fbe6bc 100644 --- a/zsh/func/init_env_darwin +++ b/zsh/func/init_env_darwin @@ -7,7 +7,7 @@ autoload prepend_to_path function init_env_darwin { - shell-log "Initializing Darwin environment" + ShellLog "Initializing Darwin environment" export OSBUILD=`sysctl -n kern.osversion` export OSVERSION=`sysctl -n kern.osproductversion` diff --git a/zsh/func/init_rc_aliases b/zsh/func/init_rc_aliases index eeae9fb..c07686f 100644 --- a/zsh/func/init_rc_aliases +++ b/zsh/func/init_rc_aliases @@ -5,7 +5,7 @@ autoload binary_exists function init_rc_aliases { - shell-log -l 'debug' "Setting up shell aliases" + ShellLog -l 'debug' "Setting up shell aliases" alias j='jobs' alias h='history' @@ -28,7 +28,7 @@ function init_rc_aliases binary_exists ledger && alias l='ledger' binary_exists gpg2 && alias gpg='gpg2' - shell-log -l debug 'Setting up suffix aliases' + ShellLog -l debug 'Setting up suffix aliases' alias -s c='vim' alias -s tex='vim' alias -s txt='vim' diff --git a/zsh/func/init_rc_configure_completion b/zsh/func/init_rc_configure_completion index c38f6fb..a58376f 100644 --- a/zsh/func/init_rc_configure_completion +++ b/zsh/func/init_rc_configure_completion @@ -3,7 +3,7 @@ function init_rc_configure_completion { - shell-log 'Initializing completion system' + ShellLog 'Initializing completion system' autoload -U compinit compinit diff --git a/zsh/func/init_rc_configure_ls b/zsh/func/init_rc_configure_ls index 1d08c35..72f42eb 100644 --- a/zsh/func/init_rc_configure_ls +++ b/zsh/func/init_rc_configure_ls @@ -7,7 +7,7 @@ function init_configure_ls local ls_options if [[ ! -e "$1" ]]; then - shell-log -l error 'Missing required path to ls binary' + ShellLog -l error 'Missing required path to ls binary' return fi @@ -19,7 +19,7 @@ function init_configure_ls ls_options='-G' fi - shell-log -l debug "Setting up aliases for $1" + ShellLog -l debug "Setting up aliases for $1" alias ls="$1 $ls_options" alias la="$1 -A $ls_options" alias ll="$1 -l $ls_options" @@ -33,7 +33,7 @@ function init_configure_ls dircolors="$HOME/.dircolors/default.cfg" fi - shell-log -l debug "Setting up dircolors: `basename $dircolors`" + ShellLog -l debug "Setting up dircolors: `basename $dircolors`" eval `$dircolors_bin $dircolors` fi } diff --git a/zsh/func/init_rc_configure_prompt b/zsh/func/init_rc_configure_prompt index 14c411c..18d3e61 100644 --- a/zsh/func/init_rc_configure_prompt +++ b/zsh/func/init_rc_configure_prompt @@ -8,7 +8,7 @@ function init_rc_configure_prompt theme=loquacious fi - shell-log -l debug 'Configuring vcs_info' + ShellLog -l debug 'Configuring vcs_info' autoload -U add-zsh-hook autoload -Uz vcs_info @@ -28,7 +28,7 @@ function init_rc_configure_prompt add-zsh-hook precmd export_gitbranch - shell-log "Configuring prompt with '$theme' theme" + ShellLog "Configuring prompt with '$theme' theme" autoload -U promptinit promptinit prompt $theme diff --git a/zsh/func/init_rc_configure_zle b/zsh/func/init_rc_configure_zle index e535898..fb946a6 100644 --- a/zsh/func/init_rc_configure_zle +++ b/zsh/func/init_rc_configure_zle @@ -3,7 +3,7 @@ function init_rc_configure_zle { - shell-log 'Configuring ZLE' + ShellLog 'Configuring ZLE' local mode=$1 if [[ -z "$mode" ]]; then @@ -13,7 +13,7 @@ function init_rc_configure_zle function configure_zle_emacs { } function configure_zle_vim { } - shell-log -l debug "Using $mode command line editing mode" + ShellLog -l debug "Using $mode command line editing mode" if [[ $mode == 'vim' ]]; then bindkey -v configure_zle_vim diff --git a/zsh/func/init_rc_darwin b/zsh/func/init_rc_darwin index bd29e3a..54440f7 100644 --- a/zsh/func/init_rc_darwin +++ b/zsh/func/init_rc_darwin @@ -5,7 +5,7 @@ autoload binary_exists function init_rc_darwin { - shell-log 'Initializing Interactive Environment for macOS' + ShellLog 'Initializing Interactive Environment for macOS' alias acls='command ls -le' diff --git a/zsh/func/init_rc_linux b/zsh/func/init_rc_linux index 43d081d..a22b42b 100644 --- a/zsh/func/init_rc_linux +++ b/zsh/func/init_rc_linux @@ -3,7 +3,7 @@ function init_rc_linux { - shell-log 'Initializing Interactive Environment for Linux' + ShellLog 'Initializing Interactive Environment for Linux' alias iptls='sudo iptables --line-numbers -nv -L' alias ip6tls='sudo ip6tables --line-numbers -nv -L' diff --git a/zsh/func/init_zsh_functions b/zsh/func/init_zsh_functions index 60f90dc..e2402a8 100644 --- a/zsh/func/init_zsh_functions +++ b/zsh/func/init_zsh_functions @@ -7,7 +7,7 @@ function init_zsh_functions { local myfpath="$HOME/.zsh/func" - shell-log "Loading functions in $myfpath" + ShellLog "Loading functions in $myfpath" for func in $myfpath/*; do [[ ! -e "$func" || -d "$func" ]] && continue @@ -15,7 +15,7 @@ function init_zsh_functions [[ "$functionName" =~ "prompt_*" ]] && continue [[ "$functionName" =~ "init_*" ]] && continue - shell-log -l debug "Loading $functionName" + ShellLog -l debug "Loading $functionName" autoload +X $functionName done diff --git a/zsh/func/init_zsh_history b/zsh/func/init_zsh_history index 63d22f0..ca9223b 100644 --- a/zsh/func/init_zsh_history +++ b/zsh/func/init_zsh_history @@ -3,7 +3,7 @@ function init_zsh_history { - shell-log 'Setting up history' + ShellLog 'Setting up history' setopt \ APPEND_HISTORY \ diff --git a/zsh/func/init_zsh_options b/zsh/func/init_zsh_options index dfc8aaf..3a41d59 100644 --- a/zsh/func/init_zsh_options +++ b/zsh/func/init_zsh_options @@ -3,7 +3,7 @@ function init_zsh_options { - shell-log 'Setting shell options' + ShellLog 'Setting shell options' # Report seconds since shell was invoked in milliseconds typeset -F SECONDS diff --git a/zsh/func/load_module b/zsh/func/load_module index 21e9bad..4114b25 100644 --- a/zsh/func/load_module +++ b/zsh/func/load_module @@ -13,15 +13,15 @@ function load_module done if [[ -z "$modpath" ]]; then - shell-log -l error "Couldn't find path to module: $mod" + ShellLog -l error "Couldn't find path to module: $mod" return 1 fi fpath+=($modpath) - shell-log "Loading module: $mod" + ShellLog "Loading module: $mod" for func in `ls $modpath`; do - shell-log "Loading function: $func" + ShellLog "Loading function: $func" autoload $func done diff --git a/zshrc b/zshrc index 4f536d9..4cbc401 100644 --- a/zshrc +++ b/zshrc @@ -1,7 +1,7 @@ #!/usr/bin/env zsh # Eryn Wells -shell-log 'Initializing Interactive Environment' +ShellLog 'Initializing Interactive Environment' autoload +X init_app_environments autoload +X init_rc_aliases