toastback 1.5: notify-send, answers you can wait for, and progress bars

In an earlier post I introduced toastback: real Windows notifications from WSL and scripts, with buttons that run your commands. Version 1.5 is out, and it's the release where toastback fits into the scripts you already have.

Your scripts' notify-send now reaches Windows

Plenty of scripts and tools already call notify-send when they finish something. In WSL, those notifications go nowhere. Now the installer adds a notify-send of its own, and the same calls show Windows notifications, without changing a line:

bash
notify-send "Backup finished" "42 GB in 12 min"
notify-send -u critical -i dialog-error "Disk almost full" "93% used on /home"

Urgency, icons, buttons and the volume-style progress hints all work. If you'd rather keep your distro's own notify-send, install with --no-notify-send.

Ask, and wait for the answer

toastback still shows a notification and gets out of the way by default. But sometimes a script needs to know what you clicked before it goes on. Add --wait, and toastback waits for the click and prints the button you chose:

bash
choice=$(toastback examples reboot-dialog | toastback --wait)
echo "You chose: $choice"

The exit code tells the other endings apart: you dismissed it, or nobody answered before --timeout. And notify-send -A buttons work the same way, printing the action you picked:

bash
answer=$(notify-send -A yes=Deploy -A no="Not now" "Build 1234 is ready")

Progress bars

This is the one you can see. A notification can now carry a progress bar, and you move it as the work goes on, without a new pop-up at every step:

A Windows notification from toastback, "Copying photos: From the camera to the NAS", with a progress bar at 60 percent for IMG_2047.jpg, "Copying…" and "6 of 10" under it, and a Cancel button

bash
id=$(toastback -t "Copying photos" --progress 0 --progress-status "Starting")
toastback update "$id" --progress 60% --status "Copying…"
toastback update "$id" --progress 100% --status "Done"

Try the one above with toastback examples progress | toastback. --duration long keeps a banner on screen for about 25 seconds, for the ones you shouldn't miss.

Install it with Scoop

On Windows, there's a Scoop package now:

powershell
scoop bucket add gergodrazsdik https://github.com/gergodrazsdik/scoop-bucket
scoop install gergodrazsdik/toastback

scoop update toastback keeps it current. Already using toastback? Run the installer again the way you installed it: your settings stay.

Everything else

The full list is in the changelog, and the code, the README and the releases are on GitHub. If toastback is useful to you, a star helps other people find it, and ideas and issues are welcome.

Tags

About Gergő Drazsdik

Software architect and developer based in Budapest, Hungary. I've spent more than 18 years building .NET systems and the infrastructure they run on. These days a growing part of my work is about how AI fits into all of that, both as something we build and as a tool we build with.

Comments

No comments yet.