From 7fa6ec605b0888ac2215544286b8791e50c3a9c7 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 3 Dec 2025 16:52:13 -0500 Subject: [PATCH] more profanity fixup --- filesystem/usr/local/bin/i3-chat | 8 +++++--- filesystem/usr/local/bin/prof | 1 + filesystem/usr/local/bin/prof-remote | 5 +++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/filesystem/usr/local/bin/i3-chat b/filesystem/usr/local/bin/i3-chat index 4ed1392..62285fd 100755 --- a/filesystem/usr/local/bin/i3-chat +++ b/filesystem/usr/local/bin/i3-chat @@ -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 diff --git a/filesystem/usr/local/bin/prof b/filesystem/usr/local/bin/prof index c46d82b..793d09a 100755 --- a/filesystem/usr/local/bin/prof +++ b/filesystem/usr/local/bin/prof @@ -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 diff --git a/filesystem/usr/local/bin/prof-remote b/filesystem/usr/local/bin/prof-remote index f648656..a34be7c 100755 --- a/filesystem/usr/local/bin/prof-remote +++ b/filesystem/usr/local/bin/prof-remote @@ -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 -- 2.30.2