Skip to content

Instantly share code, notes, and snippets.

@amin3mej
Created July 15, 2019 18:19
Show Gist options
  • Save amin3mej/5e63b22911901bf0af7efd63908adaf1 to your computer and use it in GitHub Desktop.
Save amin3mej/5e63b22911901bf0af7efd63908adaf1 to your computer and use it in GitHub Desktop.
Wait 3 seconds and if "q" button doesn't pressed, go to HACKER mode! (good for RPi)
#!/bin/bash
tmuv() ( tmux split-window -dv -t $TMUX_PANE "bash --rcfile <(echo '. ~/.bashrc;$*')" )
tmuh() ( tmux split-window -dh -t $TMUX_PANE "bash --rcfile <(echo '. ~/.bashrc;$*')" )
end=$((SECONDS+3))
while [ $SECONDS -lt $end ]; do
read -t 0.25 -N 1 input
if [[ $input = "q" ]] || [[ $input = "Q" ]]; then
exit 0
fi
done
tmuh htop
tmuv ping 8.8.8.8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment