Windows notifications with buttons, straight from WSL

I start something long in WSL: a build, a test suite, a deploy, a backup, or an AI agent working on my code. I switch to the browser "for a minute". Then I either forget about it for half an hour, or keep flipping back to the terminal to see if it's done.

On Linux I'd use notify-send, but its notifications don't reach the Windows desktop from WSL. And a notification is only half of what I want. When the build finishes, I do something next: open the log, re-run it, deploy it. I'd like to do that straight from the notification.

So I built toastback. It lets scripts and the WSL terminal show real Windows notifications with buttons, and a click on a button runs a command back in the Linux shell (or on Windows), even if the click comes hours later.

A terminal window running "toastback deploy.json" after a build, next to the Windows notification it shows: "Deploy to production?" with Deploy, Open logs and Not now buttons

One line to a notification

bash
toastback -t "Backup finished" -m "42 GB in 12 min"

A Windows notification from toastback titled "Backup finished" with the text "42 GB in 12 min"

It's a native Windows notification (a "toast", in Windows terms), so it looks like any other and waits in the notification center if you miss it. The simplest use is at the end of a long command:

bash
cargo build --release; toastback -t "Build finished" -m "exit code $?"

toastback shows the toast and exits immediately, so it never holds up your script. Add -i warning for an icon: info, warning, error and question are built in, and any PNG or JPG works too.

Install it in a minute

toastback is one small exe with no runtime to install, plus a console twin, toastback-cli.exe, for PowerShell and cmd. It installs for the current user, needs no admin rights, and leaves nothing running in the background. It needs Windows 10 22H2 or later, or Windows 11, on x64, and it works with any WSL 2 distro. The commands below use curl, which minimal distros such as Alpine don't have by default, so install it there first.

From WSL, download the installer and its checksum, verify it and read it:

bash
cd "$(mktemp -d)"
base=https://github.com/gergodrazsdik/toastback/releases/latest/download
curl -fsSLO "$base/install.sh" && curl -fsSLO "$base/SHA256SUMS"
grep ' install\.sh$' SHA256SUMS | sha256sum -c - && less install.sh

The check should print install.sh: OK. less then shows you the script: press q to leave it. If both look right, run it in the same directory:

bash
sh install.sh

This installs toastback on the Windows side and adds a toastback command to your distro, and a test notification confirms that it worked.

If the shell can't find toastback yet, open a new terminal: the command lives in ~/.local/bin. If no notification shows up, toastback doctor checks the install, the Windows notification settings and the WSL setup. Run sh install.sh --add-to-path instead if you also want toastback-cli in PowerShell and cmd.

If you'd rather not run a script, you can do by hand what it does. Download the two exes and the checksums from the latest release into a folder on the Windows side and check them. <you> is your Windows user name, which can differ from the Linux one:

bash
cd /mnt/c/Users/<you>/Downloads
base=https://github.com/gergodrazsdik/toastback/releases/latest/download
for f in toastback.exe toastback-cli.exe SHA256SUMS; do curl -fsSLO "$base/$f"; done
grep -E ' (toastback|toastback-cli)\.exe$' SHA256SUMS | sha256sum -c -

You should see two OK lines, one for each exe. Only then run the installer for your distro and user:

bash
chmod +x toastback.exe
./toastback.exe install --wsl "$WSL_DISTRO_NAME" --distro "$WSL_DISTRO_NAME" --user "$(id -un)"

The installer copies the exes to %LOCALAPPDATA%\toastback\bin, so you can delete the downloads afterwards.

No WSL? Download toastback-x86_64.zip from the same page, extract it, and run .\toastback-cli.exe install --add-to-path in that folder. Uninstalling is one command too: toastback uninstall.

Buttons that run your commands

This is the reason toastback exists. A notification with buttons is described by a small JSON file, the spec. This one asks before a deploy:

deploy.json json
{
  "title": "Deploy to production?",
  "body": "Build 1234 passed all checks.",
  "details": "Commit abc1234 by g: \"Fix the frobnicator\".\n\n412 tests passed, 0 failed. The deploy takes about 3 minutes and can be rolled back.",
  "attribution": "CI",
  "buttons": [
    { "id": "deploy", "label": "Deploy", "style": "success",
      "run": { "wsl": "./scripts/deploy.sh --env prod" } },
    { "id": "logs", "label": "Open logs",
      "run": { "open": "https://ci.example.com/builds/1234" } },
    { "id": "later", "label": "Not now" }
  ],
  "notify_on_success": true
}
bash
toastback deploy.json

A Windows notification "Deploy to production? Build 1234 passed all checks." with a green Deploy button and Open logs and Not now buttons

toastback prints the notification's id and returns right away, and the script that sent the toast may be long gone by the time you react. When you click Deploy, toastback runs ./scripts/deploy.sh --env prod in the same distro, as the same user, in the same folder the toast was sent from. It makes no difference whether you click at once or two hours later in the notification center. Open logs opens the page in the browser. Not now has no command, so it only closes the toast.

The other fields are small things: attribution is the source line under the text, style colors a button, and details and notify_on_success come up below.

A toast can have up to five buttons. Besides a WSL command, a button can run a cmd or PowerShell command, start a Windows program, or open a URL, a file or a folder.

One detail for when a notification's text or data comes from somewhere you don't control: toastback hands those values to your command as environment variables (TOASTBACK_ACTION, TOASTBACK_DATA and so on) and never pastes them into the command line.

Start from an example

You don't have to write a spec from an empty file, or read a reference first. toastback examples lists the ones that are built in:

text
$ toastback examples
simple         a plain toast: title, body and a source line, no sound
warning        a built-in icon: info, warning, error or question
build          build failed: open the log or re-run; a new one replaces it (same id)
deploy         a question with details and data; the button runs a WSL command
export         buttons that run on Windows: open a folder, PowerShell
reboot-dialog  a dialog that waits for an answer, with remind-me-later
alarm          stays on screen and loops its sound until you join or snooze

Print one:  toastback examples deploy > deploy.json
Show one:   toastback examples deploy | toastback

The deploy spec above is the deploy one, with a real script in place of its placeholder command. Pipe each one into toastback and click around. When one is close to what you need, save it, edit it, and check it before you show it:

bash
toastback examples build | toastback   # show one
toastback examples build > my.json     # start your own from it
toastback validate my.json             # check it without showing it

The repository's examples folder has a few more, for images, WSL options and Windows-side callbacks.

Details, and how it went

A toast doesn't have room for much text. Click the toast's text instead of a button, and a dialog opens with the longer details text and the same buttons:

A dialog titled "Deploy to production?" that shows the commit and the test results, with Deploy, Open logs and Not now as large buttons

Because the spec says "notify_on_success": true, a small follow-up toast shows the last line of the command's output when it finishes. If a command fails, a "failed" toast shows the exit code and the error line, like the second one below, from a backup notification's Retry button. That one is on by default.

A follow-up notification "Deploy: done", "Deploy to production? · 1.3s", "Deployed build 1234 to production"

A follow-up notification "Retry: failed", "Nightly backup · exit code 12 after 1.2s", "rsync: connection to nas.local refused"

Every click and its output also ends up in the log:

text
$ toastback log
2026-11-14T22:55:22Z  shown              blog-done  "Deploy to production?"
2026-11-14T22:55:23Z  activated          blog-done  deploy
2026-11-14T22:55:23Z  callback_started   blog-done  deploy
2026-11-14T22:55:24Z  callback_finished  blog-done  deploy  exit 0  1.3s
    stdout | Deployed build 1234 to production
2026-11-14T22:55:24Z  shown              mwh07m0b-bmpx  "Deploy: done"

More things it's good for

Questions that must not be missed

A toast banner is easy to miss, and Do Not Disturb hides it completely. With "mode": "dialog" in the spec, or --mode dialog on the command line, toastback shows a native Windows dialog instead, which Do Not Disturb doesn't hide.

bash
toastback --mode dialog -t "Hello" -m "World"   # a quick one
toastback examples reboot-dialog | toastback    # the built-in example, shown below

A Windows dialog titled "Reboot needed" asking "Updates are installed. Reboot now?" with Reboot now, Remind me later and Skip this time

In that example, Remind me later waits an hour and asks again.

Reminders that stay on screen

"scenario": "reminder" or "alarm" keeps a toast on screen until you answer it. This one could come from a weekly check:

updates.json json
{
  "title": "Updates available",
  "body": "23 packages can be upgraded in Ubuntu.",
  "attribution": "weekly check",
  "scenario": "reminder",
  "buttons": [
    { "id": "upgrade", "label": "Upgrade now", "style": "success",
      "run": { "exe": ["wt.exe", "wsl.exe", "-e", "sudo", "apt", "full-upgrade"] } },
    { "id": "later", "label": "Later" }
  ]
}

A reminder notification "Updates available: 23 packages can be upgraded in Ubuntu" with a green Upgrade now button and a Later button

Upgrade now opens a Windows Terminal tab that runs the upgrade, so you can type your sudo password there. Send it from a systemd timer or a cron job in WSL: toastback works from services too when you call it by its full path, ~/.local/bin/toastback (the README has a systemd example). For the alarm variant, try toastback examples alarm | toastback: a stand-up reminder whose sound loops until you join or snooze.

Knowing when a coding agent needs me

A notification with a blue question mark icon: "Claude Code is waiting for you", "Allow Bash? npm run test:e2e", with an Open terminal button

Coding agents like Claude Code stop and wait for a permission or an answer, usually while I'm looking at another window. A small hook calls toastback when a session is waiting, and a toast like this one brings me back. I use it every day. Know when Claude Code needs you shows how the hook works, with the script to download.

Not only WSL

You don't need WSL to use toastback. From PowerShell and cmd the command is toastback-cli, and it takes the same JSON specs:

powershell
toastback-cli -t "Build done" -m "Release build finished in 4 min"

Task Scheduler works too: point a task at toastback.exe and a JSON file. That exe is the twin without a console, so no window flashes up.

The limits

  • Windows 10 22H2 or later, or Windows 11, and x64 only.
  • Only clicks run commands. Windows doesn't report a toast that was dismissed or timed out.
  • Do Not Disturb hides toast banners, although they still land in the notification center. For things that must be seen, use dialog mode or an alarm.
  • Buttons only: there are no text input fields.
  • The exe isn't code-signed, which is a deliberate choice. With Windows 11's Smart App Control on, Windows may block it. Release builds carry a GitHub build attestation instead, which you can check with gh attestation verify.

Try it

Install it, then let the examples show you around:

bash
toastback examples                    # see what's there
toastback examples deploy | toastback # show one

Click the text, try the buttons, then look at toastback log to see what each click did. Then try the others the same way.

toastback is free and open source (GPL-3.0-or-later), and this post describes version 1.4.0. The code, the README and the releases are on GitHub. If it's useful to you, a star helps other people find it, and issues and ideas 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.

Back to the top