From 58d03e05a21873bc99419eeb0340695156df5f33 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 23 Aug 2026 20:08:12 +0200 Subject: [PATCH 1/2] Let a received Taildrop file wait to be answered A delivery can land hours after it was sent, and the toast announcing it was expiring after five seconds -- so a file that arrived while nobody was at the machine was gone from the screen before anyone could click it open. Critical urgency is what the shell reads as a popup that lives until it is clicked or dismissed, the same thing omarchy-crash-watch uses to keep its click-to-diagnose toast around. The wrapper takes options after the headline and description as well as before, which is how this argument list is built. That path had no test, and it fails quietly rather than loudly: the wrapper appends its own default urgency last, so an urgency it stopped parsing would reach notify-send as `-u critical ... -u low` and the toast would go back to expiring. Co-Authored-By: Claude Opus 5 (1M context) Co-Authored-By: Codex XHigh --- bin/omarchy-tailscale-receive | 7 ++++++- manual/35-networking.md | 2 +- test/shell.d/notification-send-test.sh | 17 +++++++++++++++++ test/shell.d/tailscale-receive-test.sh | 10 +++++++++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/bin/omarchy-tailscale-receive b/bin/omarchy-tailscale-receive index 6da2b125786d..3fa059e304b8 100755 --- a/bin/omarchy-tailscale-receive +++ b/bin/omarchy-tailscale-receive @@ -59,7 +59,12 @@ claim_path() { announce() { local path="$1" local name="${path##*/}" - local args=("Received $name" "Saved to ${dir/#$HOME/~}") + # A delivery arrives whenever the sender gets round to it, so the toast has + # to still be there when you come back to the machine. Critical urgency is + # what the shell reads as "stays until it is clicked or dismissed" -- it + # survives shell restarts too, and the file is no use if you never saw it + # land. omarchy-notification-send's default app name already bypasses DND. + local args=("Received $name" "Saved to ${dir/#$HOME/~}" -u critical) case "${name,,}" in *.png | *.jpg | *.jpeg | *.gif | *.webp | *.avif | *.bmp | *.tif | *.tiff) diff --git a/manual/35-networking.md b/manual/35-networking.md index 1c4b063c5f0a..51437723b225 100644 --- a/manual/35-networking.md +++ b/manual/35-networking.md @@ -36,7 +36,7 @@ SSH is off until you turn it on with _Setup > Security > SSHD_, which starts the [Tailscale](https://tailscale.com/) is a mesh VPN that makes reaching all your computers and servers over the internet simple and secure. Install it with _Install > Service > Tailscale_. -That gives you a Tailscale panel in the bar, which connects and disconnects the tailnet, switches accounts, and picks an exit node — your own machines and Mullvad regions both show up in the list. It also browses your machines, and that's where Taildrop lives: select a machine and press `s` to send it files, or `c`, `n`, and `d` to copy its IP, name, or full DNS name. The terminal equivalent is `omarchy tailscale send [file...]`, and files sent to you land in `~/Downloads` automatically. +That gives you a Tailscale panel in the bar, which connects and disconnects the tailnet, switches accounts, and picks an exit node — your own machines and Mullvad regions both show up in the list. It also browses your machines, and that's where Taildrop lives: select a machine and press `s` to send it files, or `c`, `n`, and `d` to copy its IP, name, or full DNS name. The terminal equivalent is `omarchy tailscale send [file...]`, and files sent to you land in `~/Downloads` automatically. The notification announcing an arrival waits until you click it open or dismiss it, so a file that turns up while you're away from the machine is still there to answer when you get back. Installing it also adds a web app for the Tailscale admin console. diff --git a/test/shell.d/notification-send-test.sh b/test/shell.d/notification-send-test.sh index e754bb6ea641..850fe519cd1e 100644 --- a/test/shell.d/notification-send-test.sh +++ b/test/shell.d/notification-send-test.sh @@ -37,6 +37,23 @@ pass "notification wrapper supports app, glyph, urgency, image, and exec options # libnotify action round-trip. grep -q -- "-A" "$args_file" && fail "notification wrapper must not register a libnotify action" +# Options are just as valid after the headline and description, which is how +# omarchy-tailscale-receive builds its argument list. An urgency that stopped +# being parsed there would leave the toast expiring before anyone saw it. +: >"$args_file" +OMARCHY_TEST_NOTIFY_ARGS="$args_file" PATH="$tmpdir:$ROOT/bin:$PATH" \ + omarchy-notification-send "Received photo.png" "Saved to ~/Downloads" -u critical -g K + +mapfile -t args <"$args_file" + +[[ ${args[2]} == "-u" && ${args[3]} == "critical" ]] || + fail "notification wrapper reads an urgency that follows the description" "$(printf '%s ' "${args[@]}")" +(( $(grep -cFx -- "-u" "$args_file") == 1 )) || + fail "notification wrapper sets the urgency once" "$(printf '%s ' "${args[@]}")" +[[ ${args[4]} == "--hint=string:omarchy-glyph:K" ]] || + fail "notification wrapper reads a glyph that follows the description" "$(printf '%s ' "${args[@]}")" +pass "notification wrapper reads options that follow the headline and description" + : >"$args_file" OMARCHY_TEST_NOTIFY_ARGS="$args_file" PATH="$tmpdir:$ROOT/bin:$PATH" \ omarchy-notification-send "Plain" >/dev/null diff --git a/test/shell.d/tailscale-receive-test.sh b/test/shell.d/tailscale-receive-test.sh index a3d45976ff13..5704740088f0 100644 --- a/test/shell.d/tailscale-receive-test.sh +++ b/test/shell.d/tailscale-receive-test.sh @@ -52,10 +52,18 @@ notifications=$(<"$WORKDIR/notifications") fail "taildrop receive saves incoming files" "$(ls "$downloads")" pass "taildrop receive saves incoming files" -grep -qF -- "Received photo.png Saved to $downloads --image $downloads/photo.png" <<<"$notifications" || +grep -qF -- "Received photo.png Saved to $downloads -u critical --image $downloads/photo.png" <<<"$notifications" || fail "taildrop receive previews received images" "$notifications" pass "taildrop receive previews received images" +# A file can arrive hours after it was sent, so the toast has to wait for the +# machine's owner rather than time out into history unseen. Critical urgency is +# how the shell is told a popup lives until it is clicked or dismissed. +while IFS= read -r line; do + [[ $line == *"-u critical"* ]] || fail "taildrop receive announcements wait to be answered" "$line" +done <<<"$notifications" +pass "taildrop receive announcements wait to be answered" + grep -q "^Received notes with space.pdf .* -g " <<<"$notifications" || fail "taildrop receive announces other files with a glyph" "$notifications" pass "taildrop receive announces other files with a glyph" From d3e651e1f31cc33efad672242e661aba6d22013f Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 23 Aug 2026 21:53:32 +0200 Subject: [PATCH 2/2] Say it in the commit message, not above the code `-u critical` next to a line that builds a notification says what it does, and the five lines explaining why it is there were a recap of the change rather than something the code could not say. The reasoning stays where it belongs, in the commit that made the change. Co-Authored-By: Claude Opus 5 (1M context) --- bin/omarchy-tailscale-receive | 5 ----- test/shell.d/notification-send-test.sh | 3 --- test/shell.d/tailscale-receive-test.sh | 3 --- 3 files changed, 11 deletions(-) diff --git a/bin/omarchy-tailscale-receive b/bin/omarchy-tailscale-receive index 3fa059e304b8..9a92cad9350e 100755 --- a/bin/omarchy-tailscale-receive +++ b/bin/omarchy-tailscale-receive @@ -59,11 +59,6 @@ claim_path() { announce() { local path="$1" local name="${path##*/}" - # A delivery arrives whenever the sender gets round to it, so the toast has - # to still be there when you come back to the machine. Critical urgency is - # what the shell reads as "stays until it is clicked or dismissed" -- it - # survives shell restarts too, and the file is no use if you never saw it - # land. omarchy-notification-send's default app name already bypasses DND. local args=("Received $name" "Saved to ${dir/#$HOME/~}" -u critical) case "${name,,}" in diff --git a/test/shell.d/notification-send-test.sh b/test/shell.d/notification-send-test.sh index 850fe519cd1e..cec38cab3394 100644 --- a/test/shell.d/notification-send-test.sh +++ b/test/shell.d/notification-send-test.sh @@ -37,9 +37,6 @@ pass "notification wrapper supports app, glyph, urgency, image, and exec options # libnotify action round-trip. grep -q -- "-A" "$args_file" && fail "notification wrapper must not register a libnotify action" -# Options are just as valid after the headline and description, which is how -# omarchy-tailscale-receive builds its argument list. An urgency that stopped -# being parsed there would leave the toast expiring before anyone saw it. : >"$args_file" OMARCHY_TEST_NOTIFY_ARGS="$args_file" PATH="$tmpdir:$ROOT/bin:$PATH" \ omarchy-notification-send "Received photo.png" "Saved to ~/Downloads" -u critical -g K diff --git a/test/shell.d/tailscale-receive-test.sh b/test/shell.d/tailscale-receive-test.sh index 5704740088f0..7878a1881ce9 100644 --- a/test/shell.d/tailscale-receive-test.sh +++ b/test/shell.d/tailscale-receive-test.sh @@ -56,9 +56,6 @@ grep -qF -- "Received photo.png Saved to $downloads -u critical --image $downloa fail "taildrop receive previews received images" "$notifications" pass "taildrop receive previews received images" -# A file can arrive hours after it was sent, so the toast has to wait for the -# machine's owner rather than time out into history unseen. Critical urgency is -# how the shell is told a popup lives until it is clicked or dismissed. while IFS= read -r line; do [[ $line == *"-u critical"* ]] || fail "taildrop receive announcements wait to be answered" "$line" done <<<"$notifications"