From 8607603e03554066a97c01126d4876318bfc4c5e Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Sat, 7 Sep 2024 19:04:28 +0530 Subject: [PATCH] [scripts] ,linkify: notify once link is generated --- scripts/.local/bin/random/,linkify | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/.local/bin/random/,linkify b/scripts/.local/bin/random/,linkify index bfdab0bb..1963a352 100755 --- a/scripts/.local/bin/random/,linkify +++ b/scripts/.local/bin/random/,linkify @@ -31,7 +31,11 @@ elif echo "$url" | grep -qE '^https://teams.microsoft.com'; then channel="$(echo "$url" | grep -o 'channelName=[^&]*' | cut -d= -f2)" printf "[Teams message in %s](%s)" "$team#$channel" "$url" else - title="$(get_title "$url")" + title="$(get_title "$url" | sed 's| - YouTube$||')" [ -z "$title" ] && title="$url" printf "[%s](%s)" "$title" "$url" -fi | tee /dev/stderr | pbcopy +fi | tee /tmp/linkify | pbcopy + +title="$(cat /tmp/linkify | sed 's|.*\[\(.*\)\](.*)|\1|')" +notify "$title" "$url" +cat /tmp/linkify \ No newline at end of file