Add tmux-guard

This function executes its arguments only if within a ~tmux~ session
master
Jacopo De Simoi 4 years ago
parent 8e44cb64ba
commit d1ebd50708
  1. 14
      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()

Loading…
Cancel
Save