Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 950 Bytes

33ec0995.md

File metadata and controls

38 lines (27 loc) · 950 Bytes
date tags
2023-01-31T09:38
nostr

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.