prof &
fi
# start emacs daemon for profanity if it doesnt exist.
-cmd="emacsclient -s profanity -nc"
-if ! pgrep -fx "$cmd" &>/dev/null; then
- $cmd &>/dev/null
+
+id=$(i3-msg -t get_tree | jq -e '.. | select(.name?) | select(.name | test("^e-irc ")).id')
+
+if [[ ! $id ]]; then
+ emacsclient -s profanity -nc &>/dev/null
fi
ssh -n $remote
fi
# -n or else it competes with the other ssh for reading stdin.
- ssh -n $remote tail -n0 -qF /home/iank/.local/share/profanity/prof-tail.log | prof-notify &
- ssh -t $remote tmux -L profanity a ||:
+ # -l iank is just a safety measure against misconfig/temporary config in .ssh/config.
+ ssh -l iank -n $remote tail -n0 -qF /home/iank/.local/share/profanity/prof-tail.log | prof-notify &
+ ssh -l iank -t $remote tmux -L profanity a ||:
builtin kill %% &> /dev/null ||:
if (( EPOCHSECONDS > start + 600 )); then
fastcon=0