diff options
Diffstat (limited to 'ar/.config/qutebrowser/config.py')
| -rw-r--r-- | ar/.config/qutebrowser/config.py | 94 |
1 files changed, 35 insertions, 59 deletions
diff --git a/ar/.config/qutebrowser/config.py b/ar/.config/qutebrowser/config.py index 8ace1af..0146621 100644 --- a/ar/.config/qutebrowser/config.py +++ b/ar/.config/qutebrowser/config.py @@ -2563,6 +2563,8 @@ config.bind("<Ctrl-]>", "command-history-prev", mode="command") # config.bind('y', 'prompt-accept yes', mode='yesno') ## userscripts +config.bind(",cr", "set-cmd-text -s -- :spawn -u -- substiqute") +config.bind(",cR", "set-cmd-text -s -- :spawn -u -- substiqute -t") os.environ["QUTE_POST_CLONE"] = 'notify-send "cloned!" "${QUTE_URL}"' config.bind("gc", "spawn -u -- gitclone") config.bind(",msg", "open -t qute://log/?level=info") @@ -2582,104 +2584,78 @@ config.bind(",qh", "open -t qute://help/index.html") config.bind(",qc", "open -t qute://help/commands.html#cmd-repeat") config.bind(",qr", "spawn --userscript qr") config.bind(",rs", "restart") -config.bind(",tk", "spawn --userscript translate --target_lang ko") -config.bind(",tk", "spawn --userscript translate --target_lang ko", mode="caret") -config.bind(",tw", "spawn --userscript translate") -config.bind(",tw", "spawn --userscript translate", mode="caret") -config.bind(",vd", "spawn qndl -v {url}") -config.bind(",vD", "hint links spawn qndl -v {hint-url}") -config.bind(",vv", "spawn mpv --quiet --detach --loop {url}") -config.bind(",vV", "hint links spawn --detach mpv --quiet --loop {hint-url}") -config.bind( - "za", - "config-cycle statusbar.show always never;; config-cycle tabs.show always never", -) -c.hints.selectors["code"] = [ - # Selects all code tags whose direct parent is not a pre tag - ":not(pre) > code", - "pre", -] -config.bind("yc", "hint code userscript code_select") -config.bind("zs", "config-cycle statusbar.show always never") -config.bind("zt", "config-cycle tabs.show always never") - session_path = os.path.join(os.environ["HOME"], ".local/share/qutebrowser/sessions/") - -# general bind, to manually enter commands, flags and arguments -config.bind( +config.bind( # general bind, to manually enter commands, flags and arguments ",sg", f"cmd-set-text -s :spawn --userscript tab-manager {session_path}", ) - -# append current focused tab to specified session -config.bind( +config.bind( # append current focused tab to specified session ",ss", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} save -f", ) - -# remove -config.bind( +config.bind( # remove ",sd", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} remove -f", ) - -# save all and overwrite specified session (update session, don't append): -config.bind( +config.bind( # save all and overwrite specified session (update session, don't append): ",sa", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} save-all -o -f", ) - -# open one or more sessions as HTML, or open index -config.bind( +config.bind( # open one or more sessions as HTML, or open index ",so", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} open -f", ) - -# restore specified sessions, or the current open HTML file if it is a valid session -config.bind( +config.bind( # restore specified sessions, or the current open HTML file if it is a valid session ",sr", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} restore -f", ) - -# restore, same as above but close all open tabs first -config.bind( +config.bind( # restore, same as above but close all open tabs first ",sR", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} restore -c -f", ) - -# merge -config.bind( +config.bind( # merge ",sm", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} merge -f", ) - -# delete session -config.bind( +config.bind( # delete session ",sx", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} delete -f", ) - -# rename -config.bind( +config.bind( # rename ",sn", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} rename -f", ) -config.bind( +config.bind( # rename with new name ",sN", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} rename -f -n", ) - -# export -config.bind( +config.bind( # export ",se", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} export -f", ) -config.bind( +config.bind( # export all windows ",sE", f"cmd-set-text -s :spawn --userscript tab-manager {session_path} export -f -w", ) - -# open help file config.bind(",sh", f"spawn --userscript tab-manager {session_path} help") - +config.bind(",tk", "spawn --userscript translate --target_lang ko") +config.bind(",tk", "spawn --userscript translate --target_lang ko", mode="caret") +config.bind(",tw", "spawn --userscript translate") +config.bind(",tw", "spawn --userscript translate", mode="caret") +config.bind(",vd", "spawn qndl -v {url}") +config.bind(",vD", "hint links spawn qndl -v {hint-url}") +config.bind(",vv", "spawn mpv --quiet --detach --loop {url}") +config.bind(",vV", "hint links spawn --detach mpv --quiet --loop {hint-url}") +config.bind( + "za", + "config-cycle statusbar.show always never;; config-cycle tabs.show always never", +) +c.hints.selectors["code"] = [ + # Selects all code tags whose direct parent is not a pre tag + ":not(pre) > code", + "pre", +] +config.bind("yc", "hint code userscript code_select") +config.bind("zs", "config-cycle statusbar.show always never") +config.bind("zt", "config-cycle tabs.show always never") config.source("themes/gruvbox.py") |
