more profanity fixup
authorIan Kelling <ian@iankelling.org>
Wed, 3 Dec 2025 21:52:13 +0000 (16:52 -0500)
committerIan Kelling <ian@iankelling.org>
Wed, 3 Dec 2025 21:52:13 +0000 (16:52 -0500)
filesystem/usr/local/bin/i3-chat
filesystem/usr/local/bin/prof
filesystem/usr/local/bin/prof-remote

index 4ed13925be046aca2291af02982699f1aee54a6a..62285fde272cddb768aeb56e7f26094e2d072dbc 100755 (executable)
@@ -25,9 +25,11 @@ if ! pgrep "^prof$" >/dev/null; then
   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
 
 
index c46d82bf82af99214d370131da2d0c86fdab30b7..793d09a33941ec254c37cfb2c4efd539576aa678 100755 (executable)
@@ -28,6 +28,7 @@ dossh=true
 if (( $# >= 1 )); then
   remote=$1
 else
+  # ssh alias
   remote=prof
   if systemctl --user --quiet is-active profanity || [[ $HOSTNAME == "$d_host" ]]; then
     dossh=false
index f6486568d9c9f87afbf2483da8dde684dc16d477..a34be7c4a8db89bb1cde76b380160068657ded9c 100755 (executable)
@@ -32,8 +32,9 @@ while true; do
     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