toastback 1.5: notify-send, answers you can wait for, and progress bars
On this page
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:
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:
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:
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:

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:
scoop bucket add gergodrazsdik https://github.com/gergodrazsdik/scoop-bucket
scoop install gergodrazsdik/toastbackscoop 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.
Read it online: https://gergodrazsdik.com/blog/toastback-1-5
Comments
No comments yet.
Leave a comment