Add qutebrowser userscripts
This commit is contained in:
parent
93630811dd
commit
ed3b45302d
3 changed files with 16 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
~/.config/polybar: polybar/
|
~/.config/polybar: polybar/
|
||||||
~/.config/qutebrowser: qutebrowser/
|
~/.config/qutebrowser: qutebrowser/
|
||||||
~/.config/termite: termite/
|
~/.config/termite: termite/
|
||||||
|
~/.local/share/qutebrowser/userscripts: qutebrowser/userscripts
|
||||||
~/.mbsyncrc: isync/.mbsyncrc
|
~/.mbsyncrc: isync/.mbsyncrc
|
||||||
~/.mutt: mutt/
|
~/.mutt: mutt/
|
||||||
~/.xinitrc: X/.xinitrc
|
~/.xinitrc: X/.xinitrc
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ config.load_autoconfig()
|
||||||
# Aliases for commands. The keys of the given dictionary are the
|
# Aliases for commands. The keys of the given dictionary are the
|
||||||
# aliases, while the values are the commands they map to.
|
# aliases, while the values are the commands they map to.
|
||||||
# Type: Dict
|
# Type: Dict
|
||||||
# c.aliases = {'w': 'session-save', 'q': 'quit', 'wq': 'quit --save'}
|
c.aliases.update({"rmqs": "spawn --userscript clean-url"})
|
||||||
|
|
||||||
# How often (in milliseconds) to auto-save config/cookies/etc.
|
# How often (in milliseconds) to auto-save config/cookies/etc.
|
||||||
# Type: Int
|
# Type: Int
|
||||||
|
|
|
||||||
14
qutebrowser/userscripts/clean-url
Executable file
14
qutebrowser/userscripts/clean-url
Executable file
|
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
from urllib.parse import urlparse, urlunparse
|
||||||
|
|
||||||
|
mode = os.environ["QUTE_MODE"]
|
||||||
|
url = os.environ["QUTE_URL"]
|
||||||
|
fifo = os.environ["QUTE_FIFO"]
|
||||||
|
|
||||||
|
(scheme, netloc, path, params, query, fragment) = urlparse(url)
|
||||||
|
clean = urlunparse((scheme, netloc, path, params, "", fragment))
|
||||||
|
|
||||||
|
with open(fifo, "w") as f:
|
||||||
|
f.write(":open {}".format(clean))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue