16 lines
354 B
Plaintext
16 lines
354 B
Plaintext
|
#!/usr/bin/env python3
|
||
|
# pdfref:// URL handler
|
||
|
|
||
|
import subprocess
|
||
|
from urllib.parse import urlparse, parse_qs
|
||
|
from sys import argv
|
||
|
|
||
|
from datatypes import PageNumber
|
||
|
|
||
|
url = urlparse(argv[1])
|
||
|
query = parse_qs(url.query)
|
||
|
|
||
|
page: PageNumber = PageNumber(int(query.get("page", ["0"])[0]))
|
||
|
|
||
|
subprocess.run(["zathura", "--page", str(page), url.path], text=True)
|