diff --git a/zshrc.org b/zshrc.org index 88b4afb..e84d902 100644 --- a/zshrc.org +++ b/zshrc.org @@ -157,7 +157,19 @@ setup-pi-webcam() :END: *** Misc helpers :pi:daily:android: - + - tmux guard + This function checks if we are in a tmux session before + executing the command; otherwise print an error and bail out +#+begin_src sh + tmux-guard() + { + if [[ -v TMUX ]]; then + $@ + else + echo tmux-guard: ensure you are in a tmux session to run $@ + fi + } +#+end_src - wttr.in #+begin_src sh wttr()