From 5ce8dc6ea98383031747d15a53b03394e46c69c9 Mon Sep 17 00:00:00 2001 From: pks Date: Tue, 3 Oct 2023 10:23:36 +0200 Subject: zsh: updates --- zsh/.zshrc | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'zsh') diff --git a/zsh/.zshrc b/zsh/.zshrc index 0a2fa37..e6f0c43 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -76,8 +76,7 @@ fi # functions # ############################################################################# -diff () -{ +function diff () { if [[ -x $(which colordiff 2>/dev/null) ]]; then colordiff "$@" else @@ -85,8 +84,7 @@ diff () fi } -irb () -{ +function irb () { which pry &>/dev/null if [[ $? -eq 0 ]]; then pry "$@" @@ -95,34 +93,29 @@ irb () fi } -lsof_kill () -{ +function lsof_kill () { lsof $1 | grep -v COMMAND | cut -d " " -f 2- | strips | cut -d " " -f 1 | xargs kill } -tln () -{ +function tln () { reply=( $(tmux list-sessions | cut -d: -f1) ) } -watch_pdflatex () -{ +function watch_pdflatex () { ls $@ | entr pdflatex --interaction=batchmode $1 echo "tell application \"Preview\" to activate" | osascript - echo "tell application \"iTerm2\" to activate" | osascript - } -pdfprevfile () -{ +function pdfprevfile () { pdftoppm $1 -f 1 -l 1 -singlefile -png } -getcert () -{ +function getcert () { openssl s_client -showcerts -connect $1 $2 } -on_gcloud () { +function on_gcloud () { curl metadata.google.internal -i -m 1 &>/dev/null if [[ $? -eq 0 ]]; then echo "yes" @@ -131,7 +124,7 @@ on_gcloud () { fi } -on_aws () { +function on_aws () { if [[ $(echo $_HOSTNAME | cut -d. -f 2) == "ec2" ]]; then echo "yes" else @@ -139,8 +132,7 @@ on_aws () { fi } -function chpwd -{ +function chpwd { if [[ -e $ZDIR/functions ]] { source ~/.zsh/functions/rtab.zsh if [[ $(pwd) == $HOME ]]; then @@ -156,6 +148,10 @@ chpwd zstyle ':prompt:rtab' fish yes zstyle ':prompt:rtab' nameddirs yes +function resizeandunsharpmask () { + convert $1 -resize 666x666 -filter Lanczos -adaptive-sharpen 5x1+0.5+0.05 $(basename $1 .$1:t:e).jpg; +} + # ############################################################################# # exports # ############################################################################# @@ -271,7 +267,7 @@ autoload -U colors && colors # possible colors: black, white, green, cyan, red, yellow, magenta case $_HOSTNAME in - *.home|barkley*|bogues*|carter*|durant*|james*|oneal*|robinson*) + *.home|barkley*|bogues*|carter*|durant*|james*|nash*|oneal*|robinson*) _HOSTCOLOR_BG=magenta _HOSTCOLOR_FG=black ;; -- cgit v1.2.3