Setting up a handler for nostr: links on your Desktop, even if you don’t use a native client

This is the most barebones possible, it will just open a web browser at with the contents of the nostr: link.

Create this file at ~/.local/share/applications/nostr-opener.desktop:

[Desktop Entry]
Exec=/home/youruser/nostr-opener %u
Name=Nostr Browser

(Replace “youruser” with your username above.)

This will create a default handler for nostr: links. It will be called with the link as its first argument.

Now you can create the actual program at ~/nostr-opener. For example:

#!/usr/bin/env python

import sys
import webbrowser

nip19 = sys.argv[1][len('nostr:'):]'{nip19}')

Remember to make it executable with chmod +x ~/nostr-opener.

This article on Nostr