From a970ceebf91ea2f2b074fea61f6eca0ab734b83c Mon Sep 17 00:00:00 2001 From: Emmet Date: Tue, 25 Jun 2024 18:02:31 -0500 Subject: [PATCH] Added doom and magit style keybinds to qutebrowser --- user/app/browser/qutebrowser.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/user/app/browser/qutebrowser.nix b/user/app/browser/qutebrowser.nix index 5b72912..e061a79 100644 --- a/user/app/browser/qutebrowser.nix +++ b/user/app/browser/qutebrowser.nix @@ -105,6 +105,16 @@ in programs.qutebrowser.enable = true; programs.qutebrowser.extraConfig = '' +import sys +import os.path +secretsExists = False +secretFile = os.path.expanduser("~/.config/qutebrowser/qutesecrets.py") + +if (os.path.isfile(secretFile)): + sys.path.append(os.path.dirname(secretFile)) + import qutesecrets + secretsExists = True + config.set('qt.args',['ignore-gpu-blacklist','enable-gpu-rasterization','enable-native-gpu-memory-buffers','num-raster-threads=4']) config.load_autoconfig(False) @@ -184,8 +194,20 @@ config.set('fileselect.folder.command', ['kitty','-e','ranger','--choosedir={}'] # bindings from doom emacs config.bind('', 'cmd-set-text :') +config.bind('.', 'cmd-set-text :') +config.bind('b', 'bookmark-list') +config.bind('h', 'history') +config.bind('gh', 'open https://github.com') +config.bind('gl', 'open https://gitlab.com') +config.bind('gc', 'open https://codeberg.org') +if (secretsExists): + config.bind('gg', 'open '+qutesecrets.mygiteadomain) config.bind('', 'completion-item-focus prev', mode='command') config.bind('', 'completion-item-focus next', mode='command') +config.bind('', 'fake-key ', mode='normal') +config.bind('', 'fake-key ', mode='normal') +config.bind('', 'fake-key ', mode='insert') +config.bind('', 'fake-key ', mode='insert') # bindings from vimium config.bind('t', 'open -t')