diff options
| author | Akshay Nair <phenax5@gmail.com> | 2024-08-20 00:07:39 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2024-08-20 00:07:39 +0530 |
| commit | fb6fa85d49ea921c2913c0e7fafeb43fe873e624 (patch) | |
| tree | 24f7cdfcc98db24b2904c3fcaf3cebb099d4a41d /modules/firefox.home/chrome/globalKeybindings.uc.js | |
| parent | 3ead21983a9e150ce57e40189f4e472421abc2ee (diff) | |
| download | nixos-config-fb6fa85d49ea921c2913c0e7fafeb43fe873e624.tar.gz nixos-config-fb6fa85d49ea921c2913c0e7fafeb43fe873e624.zip | |
Add sidebar tabs for firefox
Diffstat (limited to 'modules/firefox.home/chrome/globalKeybindings.uc.js')
| -rw-r--r-- | modules/firefox.home/chrome/globalKeybindings.uc.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/firefox.home/chrome/globalKeybindings.uc.js b/modules/firefox.home/chrome/globalKeybindings.uc.js index dd1f0f7..7341fc0 100644 --- a/modules/firefox.home/chrome/globalKeybindings.uc.js +++ b/modules/firefox.home/chrome/globalKeybindings.uc.js @@ -13,12 +13,16 @@ RELEASE: [ [ctrl(shift(key('J'))), moveSelectedTabBy(+1)], [ctrl(shift(key('K'))), moveSelectedTabBy(-1)], + [ctrl(shift(key('B'))), toggleTabSidebar()], [ctrl(alt(key('p'))), togglePassthrough(), { modes: ALL_MODES }], ], PRESS: [ // Block default key bindings [ctrl(shift(key('J'))), preventDefault()], [ctrl(shift(key('K'))), preventDefault()], + [ctrl(shift(key('B'))), preventDefault()], + [ctrl(key('h')), preventDefault()], + [ctrl(key('b')), preventDefault()], [ctrl(key('j')), preventDefault(nextTab())], [ctrl(key('k')), preventDefault(prevTab())], @@ -37,6 +41,9 @@ const moveSelectedTabBy = incr => () => updateSelectedTabIndex(incr); const togglePassthrough = () => () => UC.globalKeybindings.updateMode(m => m !== MODE_PASSTHRU ? MODE_PASSTHRU : MODE_NORMAL) + const getSidebarId = () => [...SidebarController.sidebars].find(([_, p]) => p.label?.match(/sidetabs/i))?.[0]; + const toggleTabSidebar = () => () => SidebarController.toggle(getSidebarId() ?? undefined); + const MODE_PASSTHRU = 'passthru'; const MODE_NORMAL = ''; const ALL_MODES = [MODE_NORMAL, MODE_PASSTHRU]; |
