Giter Club home page Giter Club logo

apekey's Introduction

apekey apekey

apekey

List and browse your XMonad keymap.

Install

Usage

Apekey reads your xmonad.hs config and looks for comments with special formats. Based on these comments, apekey will parse and generate the keymap, and will render it in a dedicated window.

Once you have annotated your keybinds simply launch apekey. Press Tab to fuzzy search keybindings by key and/or description.

Launching apekey

You can create a keybind to launch it from XMonad. For example, using it as a scratchpad:

-- # Keymap
keybinds = ([
-- ...

-- Keymap
, ("M-S-,", namedScratchpadAction scratchpads "keymap")

-- ...

scratchpads = [
-- ...

, NS "keymap" "apekey"
(title =? "apekey")
(customFloating $ W.RationalRect 0.4 0.2 0.3 0.8)
]

CLI

Apekey can be launched from the terminal

apekey --help

Keybinds annotation

⚠ For now apekey only supports keybindings specified in emacs-style format (EZConfig)

Example

xmonad.hs config

-- # XMonad keymap
keybinds = ([
-- ## Basics
-- Recompile and restart XMonad
("M-C-q",       spawn "xmonad --recompile; xmonad --restart")
-- Refresh XMonad
, ("M-C-r",       refresh)
-- Kill current window
, ("M-x",         kill)

-- ## Workspace navigation
-- "M-<Workspace key>" Move to workspace x
-- "M-S-<Workspace key>" Move current window to workspace x
-- Switch to last workspace
, ("M-<Tab>",       toggleRecentWS)
-- Switch to next workspace
, ("M-<Page_Up>",   nextWS)
-- Switch to previous workspace
, ("M-<Page_Down>", prevWS)
-- Exec the action of the current workspace
, ("M-<Return>",    chooseAction wsActions)

-- ## Window navigation
-- "M-↑→↓←" Navigate through windows
-- "M-S-↑→↓←" Swap windows
-- Focus next window up
, ("M-k",         windows W.focusUp)
-- Focus next window down
, ("M-j",         windows W.focusDown)

-- ...

-- #
-- # [Title]

Tell apekey to start parsing from here. An optional title can be given. Use a second comment -- # to mark the end of the keybindings declaration area.

-- # XMonad keymap

-- your keybindings declaration

-- somewhere below
-- #
-- ## Section

Define a section of keybindings. All subsequent annotated keybinds will belong to this section until another section is defined.

-- ## Basics
-- a keybind declaration
-- a keybind declaration
-- a keybind declaration

-- ## Another section
-- keybindings declarations...
-- Keybind description

Adds a description to a keybinding. That is, a regular comment. The next line must be the corresponding keybinding declaration. Apekey will automatically parse and extract the keybinding from it.

-- Kill current window
, ("M-x",         kill)
-- "<keys>" Description

Some keybindings are not declared "inline" or using the emacs format. e.g. mouse binding, workspaces/topics/screen navigation bindings etc... are common cases. For these it is not possible to use the simple -- description comments.

Instead, you can use this comment format to arbitrary write fake keybindings.

-- "M-<Topic key>" Move to topic x
-- "M-S-<Topic key>" Move current window to topic x
-- ! Keybind ignored

Annotate a keybind but do not render it.

  -- ! Description
  , ("<M-u>",   spawn "script.sh")

Configuration

Apekey will look for a config file at $XDG_CONFIG_HOME/apekey/apekey.toml.

Set xmonad_config to the path pointing to your xmonad.hs configuration file.

xmonad_config = "~/.config/xmonad/xmonad.hs"

# color theme
theme = "Dark" # Light, Dark (default), Tars

# [font]
# title_size = 22
# section_size = 16
# keybind_size = 16
# text_size = 16
# error_size = 16

TODO

  • highlight fuzzy matches

License

Mozilla Public License 2.0

apekey's People

Contributors

doums avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

sgtrusty

apekey's Issues

How do I exclude bindings?

Hi @doums this is very useful software, thank you for making this!

I have a question though, and my question is whether you can exclude bindings that are commented out, I tried using the -- # syntax around the commented out bindings but the rest of my bindings weren't picked up, also apekey was picking up the commented out bindings, is there any way to do this? If not I can just move the commented bindings outside of the bit that apekey evaluates.

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.