qutebrowser: add copy title bind

This commit is contained in:
dogeystamp 2023-05-19 21:28:04 -04:00
parent eb181d461a
commit 395f9417fe
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 11 additions and 1 deletions

View File

@ -103,6 +103,15 @@ c.hints.selectors["code"] = [
]
config.bind("cc", "hint code userscript code_select.py")
# copy the title
c.hints.selectors["title"] = [
"h1",
"h2",
"h3",
"h4",
]
config.bind("ct", "hint title userscript code_select.py")
# use libre redirects
config.bind(",fl", "hint links userscript fixlink.sh")
config.bind(",fL", "hint links userscript fixlink-tab.sh")

View File

@ -40,7 +40,8 @@ def main():
pyperclip.copy(code_text)
send_command_to_qute(
"message-info 'copied to clipboard: {info}{suffix}'".format(
info=code_text.splitlines()[0],
# message-info doesn't support escape codes for ' so we replace them
info=code_text.splitlines()[0].replace("'", "\""),
suffix="..." if len(code_text.splitlines()) > 1 else ""
)
)