Add fh userscript
This commit is contained in:
parent
b12a3603db
commit
4ba21cd72b
2 changed files with 18 additions and 1 deletions
|
|
@ -11,7 +11,9 @@ config.load_autoconfig()
|
|||
# Aliases for commands. The keys of the given dictionary are the
|
||||
# aliases, while the values are the commands they map to.
|
||||
# Type: Dict
|
||||
c.aliases.update({"rmqs": "spawn --userscript clean-url"})
|
||||
c.aliases.update(
|
||||
{"rmqs": "spawn --userscript clean-url", "fh": "spawn --userscript fh-add"}
|
||||
)
|
||||
|
||||
# How often (in milliseconds) to auto-save config/cookies/etc.
|
||||
# Type: Int
|
||||
|
|
|
|||
15
qutebrowser/userscripts/fh-add
Executable file
15
qutebrowser/userscripts/fh-add
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
from urllib.parse import urlencode
|
||||
|
||||
url = os.environ["QUTE_URL"]
|
||||
fifo = os.environ["QUTE_FIFO"]
|
||||
title = os.environ["QUTE_TITLE"]
|
||||
|
||||
query = {"title": title, "url": url}
|
||||
|
||||
share_link = "https://metagram.net/firehose/share?{}".format(urlencode(query))
|
||||
|
||||
with open(fifo, "w") as f:
|
||||
f.write(":open {}".format(share_link))
|
||||
Loading…
Add table
Add a link
Reference in a new issue