Skip to content

Instantly share code, notes, and snippets.

@abihf
Created December 11, 2025 03:08
Show Gist options
  • Select an option

  • Save abihf/d615e25e56f6856c9aeaa8ff07929803 to your computer and use it in GitHub Desktop.

Select an option

Save abihf/d615e25e56f6856c9aeaa8ff07929803 to your computer and use it in GitHub Desktop.
xdg-open using handler and app2unit
#!/bin/sh
url="${1}"
mime="$(handlr mime --json "${url}" | jq -r '.[0].mime')"
handler="$(handlr get --json "${mime}" | jq -r '.handler')"
exec app2unit "${handler}" "${url}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment