#!/usr/bin/env bash # # shell functions # # shellcheck source="../scripts/shared.sh" export DOTFILES="$HOME/.dotfiles" source "$DOTFILES/scripts/shared.sh" # Weather in Tampere, or other city weather() { # https://github.com/chubin/wttr.in#usage local city="${1:-Tampere}" curl "http://wttr.in/${city// /+}?2nFQM&lang=fi" } # Docker ssh-docker() { docker exec -it "$@" bash } # All the dig info digga() { dig +nocmd "$1" any +multiline +noall +answer } # Rector project to php version 8.2 by default. rector() { local php="${1:-82}" docker run -v "$(pwd)":/project rector/rector:latest process \ "/project/$1" \ --set "php${php}" \ --autoload-file /project/vendor/autoload.php } # Commit everything commit() { commitMessage="$*" if [ "$commitMessage" = "" ]; then commitMessage="Automated commit" fi git add . eval "git commit -a -m '${commitMessage}'" } scheduler() { while :; do php artisan schedule:run echo "Sleeping 60 seconds..." sleep 60 done } # Defines default antigen bundles x-default-antigen-bundles() { export ZSH_TMUX_AUTOSTART=false export ZSH_TMUX_CONFIG="$DOTFILES/config/tmux/tmux.conf" export ZSH_TMUX_UNICODE=true export ZSH_TMUX_AUTOQUIT=false export ZSH_TMUX_DEFAULT_SESSION_NAME=main # Add keychain to ssh-agent args when on macOS have brew && zstyle :omz:plugins:ssh-agent ssh-add-args --apple-load-keychain # these should be always available antigen bundle tmux antigen bundle colored-man-pages antigen bundle command-not-found antigen bundle ssh-agent # antigen bundle MichaelAquilina/zsh-you-should-use antigen bundle jreese/zsh-titles antigen bundle unixorn/autoupdate-antigen.zshplugin antigen bundle zsh-users/zsh-completions antigen bundle zsh-users/zsh-syntax-highlighting # these should be available if there's need have brew && antigen bundle brew have nvm && antigen bundle nvm have nvm && antigen bundle "$DOTFILES/config/zsh/plugins/nvm-auto-use" have php && antigen bundle php have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv have rvm && antigen bundle unixorn/rvm-plugin # the theme to use antigen theme romkatv/powerlevel10k }