Why Nostr?What is Njump?
fiatjaf /
npub180c…h6w6
2023-01-31 15:38:01

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

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 https://nostr.guru/ 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
Type=Application
StartupNotify=false
MimeType=x-scheme-handler/nostr;

(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:'):]
webbrowser.open(f'https://nostr.guru/{nip19}')

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

Author Public Key
npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6