Giter Site home page Giter Site logo

alexherbo2 / krabby Goto Github PK

View Code? Open in Web Editor NEW
303.0 10.0 20.0 281 KB

A keyboard interface to the web, inspired by Kakoune

Home Page: https://krabby.netlify.app

License: The Unlicense

Makefile 0.26% JavaScript 20.30% Shell 8.99% HTML 66.15% CSS 4.30%
krabby webextension keyboard-interface subject-object-verb multiple-selections link-hints tab-search kakoune

krabby's People

Contributors

abstractlyzach avatar alexherbo2 avatar jjk96 avatar postsolar avatar seerlite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

krabby's Issues

Hover on elements

Some websites have menus that expand when you hover over it. Is there a way to trigger this right now?

Open in new tab doesn't seem to work in firefox

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

Keymap change

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?

20200731160434

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?

Disable krabby based on URL

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.

How to style/customize mode indicator

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!

Is the Crystal depency actually necessary?

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!

mpv does not work by default on Vivaldi >3.0 or when using "proprietary media codecs" (libffmpeg.so)

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.

dmenu not working in firefox

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
]]

Add themes or allow to specify own stylesheet

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.

Post releases

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

Manifest v3 Update Breaks Installation on Firefox

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

Add an external filter to the yank commands

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.

Issues with the command

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.

What to do on Krabby’s side

We can add a context for tables, and map y to the following actions:

  • y β†’ Yank the Markdown representation of the table,
  • Y β†’ Yank the raw (HTML) representation of the table.

Be more generic

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).

Alt_R doesn't function as an Alt key

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: ''

how to set Hint keyMap

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

build: `find` uses a feature macOS /usr/bin/find does not understand

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]
<....>

Make installation instructions stand out in `make` output

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".

image
There are many pages of text above that. At first it seemed like running make in ~/.config/krabby is enough.

Provide a way to pick manifest version when compiling

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.

Chrome store

Hi there,

Did you plan to publish the extension on the Chrome Store ?

Regards

Document the upgrade process

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.

Tab and window commands on Manjaro Linux

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!

Krabby Lite?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.