summaryrefslogtreecommitdiff
path: root/zsh
diff options
context:
space:
mode:
authorpks <pks@pks.rocks>2023-10-03 10:23:36 +0200
committerpks <pks@pks.rocks>2023-10-03 10:23:36 +0200
commit5ce8dc6ea98383031747d15a53b03394e46c69c9 (patch)
tree6a6b28611bbff05a0ceabbf48422c281e0fb4528 /zsh
parentf097ad93be456c08c0079d7f6b4f1fd52b01d96d (diff)
zsh: updates
Diffstat (limited to 'zsh')
-rw-r--r--zsh/.zshrc34
1 files changed, 15 insertions, 19 deletions
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 <dev/null > $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
;;