alexherbo2 / krabby Goto Github PK
View Code? Open in Web Editor NEWA keyboard interface to the web, inspired by Kakoune
Home Page: https://krabby.netlify.app
License: The Unlicense
A keyboard interface to the web, inspired by Kakoune
Home Page: https://krabby.netlify.app
License: The Unlicense
Some websites have menus that expand when you hover over it. Is there a way to trigger this right now?
Adding
krabby.modes.modal.map('Link', ['Control', 'Enter'], () => alert('Tchou'), 'Open link in new tab', 'Open links')
to the config.js works; a popup with Tchou
appears.
Its not a missing default either since adding
krabby.modes.modal.map('Link', ['Control', 'Enter'], () => krabby.commands.openInNewTab(krabby.selections), 'Open link in new tab', 'Open links')
doesn't work, which seems to suggest that krabby.commands.openInNewTab
somehow fails.
I'm on Firefox 73.0.1
Hallo π ! Pesky COLEMAK user here. Just looking to change the keymap, and I believe I remapped in config.js, but doesn't seem to have an effect.
The help reflects the change accurately, but the actual keybinds don't. Any idea what I'm doing wrong?
My config.js (which I checked is in the package.zip):
// Configuration for Krabby (https://github.com/alexherbo2/krabby/blob/master/src/krabby)
const { modes } = krabby;
const { modal } = modes;
modal.keyMap = {
Backquote: { key: "`", shiftKey: "~" },
Digit1: { key: "1", shiftKey: "!" },
Digit2: { key: "2", shiftKey: "@" },
Digit3: { key: "3", shiftKey: "#" },
Digit4: { key: "4", shiftKey: "$" },
Digit5: { key: "5", shiftKey: "%" },
Digit6: { key: "6", shiftKey: "^" },
Digit7: { key: "7", shiftKey: "&" },
Digit8: { key: "8", shiftKey: "*" },
Digit9: { key: "9", shiftKey: "(" },
Digit0: { key: "0", shiftKey: ")" },
Minus: { key: "-", shiftKey: "_" },
Equal: { key: "=", shiftKey: "+" },
KeyQ: { key: "q", shiftKey: "Q" },
KeyW: { key: "w", shiftKey: "W" },
KeyE: { key: "f", shiftKey: "F" },
KeyR: { key: "p", shiftKey: "P" },
KeyT: { key: "g", shiftKey: "G" },
KeyY: { key: "j", shiftKey: "J" },
KeyU: { key: "l", shiftKey: "L" },
KeyI: { key: "u", shiftKey: "U" },
KeyO: { key: "y", shiftKey: "Y" },
KeyP: { key: ";", shiftKey: ":" },
BracketLeft: { key: "[", shiftKey: "{" },
BracketRight: { key: "]", shiftKey: "}" },
Backslash: { key: "\\", shiftKey: "|" },
KeyA: { key: "a", shiftKey: "A" },
KeyS: { key: "r", shiftKey: "R" },
KeyD: { key: "s", shiftKey: "S" },
KeyF: { key: "t", shiftKey: "T" },
KeyG: { key: "d", shiftKey: "D" },
KeyH: { key: "h", shiftKey: "H" },
KeyJ: { key: "n", shiftKey: "N" },
KeyK: { key: "e", shiftKey: "E" },
KeyL: { key: "i", shiftKey: "I" },
Semicolon: { key: "o", shiftKey: "O" },
Quote: { key: "'", shiftKey: '"' },
KeyZ: { key: "z", shiftKey: "Z" },
KeyX: { key: "x", shiftKey: "X" },
KeyC: { key: "c", shiftKey: "C" },
KeyV: { key: "v", shiftKey: "V" },
KeyB: { key: "b", shiftKey: "B" },
KeyN: { key: "k", shiftKey: "K" },
KeyM: { key: "m", shiftKey: "M" },
Comma: { key: ",", shiftKey: "<" },
Period: { key: ".", shiftKey: ">" },
Slash: { key: "/", shiftKey: "?" },
};
As an aside, is it better to remap via keyMap or another way?
Sometimes I require disabling the extension completely as it overrides some styles and keys.
Mostly when doing local development involving browser. Is there a way to disable certain URLs, such as anything that starts with http://localhost
or similar.
Maybe it is good to mention that the developer version or unbranded version of Firefox is needed to be able to install unsigned extensions.
Or maybe you could sign the package? (I don't know how much work that is to set up)
Something similar to @occivinkβs phantom selections.
Have you heard of Vieb? https://github.com/Jelmerro/Vieb
Maybe you could add it to the list of alternatives :)
Hi!
I was wondering if there's any way to change the appearance of the "current mode" indicator from config.js. I'd like to give it dark colors and make it transparent, so it doesn't stand out so much on dark themed pages.
I was thinking of just applying an userstyle globally that modifies #notification
(also, isn't that way too generic as an id? idk how css collisions work tho so whatever :p). But seeing as how you can change the appearance of hints from config.js I thought maybe this could be changed there as well.
Thanks!
I can't figure out how to open an arbitrary url without using the mouse. Is any omnibar or ex-mode functionality planned?
i've gotten used to kak with my dvorak keyboard... can i disable the keyboard layout independence in the config? if so how?
thanks!
I noticed that the installation script requires Crystal to be installed but I can't find anywhere that it is actually used. While I personally don't have a problem installing Crystal, others might view that dependency as friction that prevents adoption of Krabby.
Thank you for Krabby!
I'm using the default configuration.
Browser: Vivaldi (I can reproduce it in Chromium)
OS: Arch Linux
I tried all the mpv commands listed here in their corresponding context. mpv doesn't open, and the Shell extension shows an error in vivaldi://extensions.
Error in event handler: Error: Attempting to use a disconnected port object
Context
_generated_background_page.html
Stack Trace
src/background.js:10 (anonymous function)
const shell = {} shell.port = chrome.runtime.connectNative('shell') chrome.runtime.onConnectExternal.addListener((port) => { // Send request to the application port.onMessage.addListener((request) => { shell.port.postMessage(request) }) // Receive response shell.port.onMessage.addListener((response) => { > port.postMessage(response) < }) })
^The line I enclosed in >
/<
is highlighted.
Is this error relevant to mpv not opening or is it just a coincidence? It seemed to appear everytime I tried mpv bindings.
Thank you so much for Krabby! I'm loving the extension so far.
I opened firefox from terminal, and when I hit q I get this:
Extension error: Error: Attempt to postMessage on disconnected port moz-extension://b9ea2c28-6460-4bc6-ba94-0b91439a1572/src/background.js 6
[[Exception stack
@moz-extension://b9ea2c28-6460-4bc6-ba94-0b91439a1572/src/background.js:6:16
Current stack
applySafeWithoutClone@resource://gre/modules/ExtensionCommon.jsm:620:13
addListener/asyncWithoutClone/<@resource://gre/modules/ExtensionCommon.jsm:2428:39
]]
I think it would be cool to have an option to customize Krabby's look, especially the hints. When there are many elements on the page it becomes much less readable (at least that's my impression). For now I just edit the JS code.
Besides that, great work. I've just started testing and I really like it.
I'm very interested in trying this out, but not willing to run code as root to build a browser extension (required to install crystal-lang). Do you have any plans to post releases in the near future?
Best,
Daniel
Basically the title, Krabby and the related extensions no longer install by default in Firefox (at least version 89.0.2).
I hacked around this by changing manifest_version
to 2
and changing service_worker: "background.js"
to scripts: ["background.js"]
, but some keybindings seem subtly broken for e.g. editor
(Ctrl-i
does nothing) EDIT: I'm not sure if this is directly related to the manifest changes
Happy to provide any more information you need! Apologies in advance if I've missed something obvious
Iβm currently playing with Surfingkeys, as suggested by @AdamWagner in Scroll β #1.
One of its features Iβm really impressed by is its y (m) c command to yank one or multiple columns in a table.
It is already possible in Krabby, because it shines for selecting elements at their structural (DOM) level, but it is clearly not as straightforward as in Surfingkeys.
The feature is a one-shot, and not very composable; it is unclear to me to decide what to yank: do we want the text content, links, something else? In either way, the inner structure is lost.
We can add a context for tables, and map y to the following actions:
Why restricting the feature to tables. How about adding a page level context (when <body>
is selected), and move inside y to yank the page address and description (currently, these two commands belong to the Command context), and in the Command context, yank the Markdown and raw representation of the selections.
What prevent me to do it is Iβm not fond of including custom libraries in the base project.
Another possibility is to have y to always yank the HTML representation, with an external filter, so we can use Pandoc (configurable), and Alt + y to do the same, but without the filtering (the raw version).
Using an external filter has the nice add to not enforce Markdown output (which is currently the case for Y commands).
I'm so excited for Krabby as a Kakoune user. I couldn't find Krabby in either Chrome or Firefox extension stores. Krabby has been around for a while now. What is the reason it is not in the extension stores?
When I go to the Krabby website, all commands that use Alt + ?
will work when pressed with Alt_L
but not Alt_R
. For example, I can use Alt_L + Esc
to toggle Krabby, but Alt_R + Esc
is a no-op.
Here is the output of wev for debugging purposes:
[14: wl_keyboard] key: serial: 8009; time: 8654130; key: 64; state: 1 (pressed)
sym: Alt_L (65513), utf8: ''
[14: wl_keyboard] modifiers: serial: 0; group: 0
depressed: 00000008: Mod1
latched: 00000000
locked: 00000000
[14: wl_keyboard] key: serial: 8011; time: 8654209; key: 64; state: 0 (released)
sym: Alt_L (65513), utf8: ''
[14: wl_keyboard] modifiers: serial: 0; group: 0
depressed: 00000000
latched: 00000000
locked: 00000000
[14: wl_keyboard] key: serial: 8013; time: 8654702; key: 108; state: 1 (pressed)
sym: Alt_R (65514), utf8: ''
[14: wl_keyboard] modifiers: serial: 0; group: 0
depressed: 00000008: Mod1
latched: 00000000
locked: 00000000
[14: wl_keyboard] key: serial: 8015; time: 8654796; key: 108; state: 0 (released)
sym: Alt_R (65514), utf8: ''
Hi!
The few times I've installed Krabby I noticed it creates an empty git repository inside ~/config/krabby/
. Is that a bug?
[brave, macos 10.15.4]
when i press q or alt-q nothing happens, chrome-dmenu is installed.
the keyMap
for instances of Hint
seem more difficult to set than those of Modal
.
Can you give an example of how to do this from config.js
? I have managed to do it by overwriting the code in packages/hint.js
but I'd rather not do so
Running make
on macOS 10.14 shows find
usage. find
is /usr/bin/find
, from macOS.
% make
STATIC_BUILD="no" BUILD_EXTENSIONS="yes" INTERACTIVE="yes" scripts/install
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Dependencies: git zip jq
β― Git
β― Zip
β― jq
Dependencies: crystal shards (Non-static build)
β― Crystal
β― Shards
Dependencies: xclip mpv pandoc (Optional)
β― xclip
Please install xclip
https://github.com/astrand/xclip
β― mpv
β― Pandoc
Please install Pandoc
https://pandoc.org
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Extension: Krabby
Description: A keyboard interface to the web
Repository: https://github.com/alexherbo2/krabby
Path: /Users/dottedmag/.config/krabby
Dependencies: jq zip
Building:
Copying: /Users/dottedmag/inbox/krabby/src/. β /Users/dottedmag/.config/krabby/packages
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]
Copying: /Users/dottedmag/inbox/krabby/bin/. β /Users/dottedmag/.local/bin
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]
<....>
Adding boxes or making instructions for specific browser stand out more could help begginers and newcomers.
The make
script spits out quite a lot of text. At the end of it there are further instructions. But the instructions for adding Krabby to the browser are not as visible as the last two boxes. I had no previous experience with third party extensions in my browser and there's no info on the website nor in README so I found it quite difficult to add Krabby as an extension. It simply says "follow the onscreen instructions".
There are many pages of text above that. At first it seemed like running make
in ~/.config/krabby
is enough.
Next has been renamed a few months ago to Nyxt.
The new repo address is https://github.com/atlas-engineer/nyxt and the new website address is https://nyxt.atlas.engineer/.
Thanks!
Hi, I was trying to run Krabby on firefox, I have a developer edition, but when I try to follow the instructions I jsut get a "This addon could not be installed because it appears to be corrupt.", and I can't find why this is, could you help me out?
I created this issue due to this error but now I find it is an issue with Firefox complaining about manifest V3, I worked it around getting the repos and checking out the version prior to the change to V3, I think it would be good to provide a way for the user to pick the manifest version he wants to compile the packages with, doing it manually is no big deal but surely takes time if you (like me) didn't knew a thing about addons and firefox and so on, thanks for you work, I'm enjoying Krabby now.
Hi there,
Did you plan to publish the extension on the Chrome Store ?
Regards
I installed krabby a couple months ago. If I now do a git pull, would that be reflected in my installed extensions? Do I need to go through the whole installation process again to update krabby and its components? Or are there some shortcuts to be taken? These things would be nice to have documented.
I am trying to use Krabby on Manjaro Linux under SwayWM both in the Firefox Developer Edition and Chromium. Most of the commands (scrolling, selecting, clicking) work as expected, but none of the commands for tabs and windows is (t, n, x and so on).
In Firefox, there are no errors what so ever. It just does nothing. In Chromium, there are those errors in the console:
Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
extension.js:32 Uncaught Error: Attempting to use a disconnected port object
at Object.KrabbyExtension.krabby.extensions.commands.send (extension.js:32)
at Object.command (extension.js:145)
at onKey (modal.js:210)
So it seems to me some process is not running.
Can you please tell where to investigate so I can get you more information of what goes wrong with my setup?
PS: I am a big fan of your Kakoune works!
This project looks cool! Is it possible to navigate the web inspector with krabby?
For Chromebooks or Windows, it'd be nice to have a Lite version available for Chrome and Firefox in the appropriate stores. This would have to drop some features.
I was able to get Krabby installed in Chromium on Windows without extensions. No luck doing the same for Firefox.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.