GithubHelp home page GithubHelp logo

igui / xremap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xremap/xremap

0.0 2.0 0.0 85 KB

Dynamic key remapper for X Window System

License: MIT License

Makefile 0.60% Ruby 7.90% C 91.50%

xremap's Introduction

xremap

Dynamic key remapper for X Window System

Project status

This is an experimental project to achieve a comfortable configuration experience of key remap on Linux.

Some issues are reported and some of them are hard to reproduce or resolve immediately. If you can fix any open issues on these platforms, you'll be welcomed as a maintainer of xremap.

Description

xremap is a key remapper for X Window System. With xremap's Ruby DSL, you can simply write configuration of key bindings.

remap 'C-b', to: 'Left'

And you can configure application-specific key bindings, which is dynamically applied based on a current window.

window class_only: 'slack' do
  remap 'Alt-k', to: 'Alt-Up'
  remap 'Alt-j', to: 'Alt-Down'
end

While xremap's configuration is written in Ruby, you can run xremap without Ruby installation because it embeds mruby to evaluate configuration.

Installation

Build dependencies

  • ruby
  • bison
  • libx11-dev

While ruby is not runtime dependency for xremap, mruby embedded in xremap requires ruby to build.

From source code

$ git clone https://github.com/k0kubun/xremap
$ cd xremap
$ make
$ sudo make install # or `make DESTDIR=~/bin install`

Usage

$ xremap /path/to/config

See examples to write config file.

Emacs-like bindings

window class_not: 'urxvt' do
  remap 'C-b', to: 'Left'
  remap 'C-f', to: 'Right'
  remap 'C-p', to: 'Up'
  remap 'C-n', to: 'Down'

  remap 'M-b', to: 'Ctrl-Left'
  remap 'M-f', to: 'Ctrl-Right'

  remap 'C-a', to: 'Home'
  remap 'C-e', to: 'End'

  remap 'C-k', to: ['Shift-End', 'Ctrl-x']

  remap 'C-d', to: 'Delete'
  remap 'M-d', to: 'Ctrl-Delete'
end

Simulate macOS's command key

Following configuration works fine with above Emacs-like bindings.

%w[a z x c v w t].each do |key|
  remap "Alt-#{key}", to: "C-#{key}"
end

Application launcher

You can start an application by a shortcut key. See examples/window_switcher too.

remap 'C-o', to: execute('nocturn')
remap 'C-u', to: execute('google-chrome-stable')
remap 'C-h', to: execute('urxvt')

Application-specific key bindings

See xremap's stdout to find a window class name of your application.

window class_only: 'slack' do
  remap 'Alt-n', to: 'Ctrl-k'
  remap 'Alt-k', to: 'Alt-Up'
  remap 'Alt-j', to: 'Alt-Down'
  remap 'Ctrl-Alt-k', to: 'Alt-Shift-Up'
  remap 'Ctrl-Alt-j', to: 'Alt-Shift-Down'
end

Note

xremap is designed to have similar functionality with Karabiner and karabiner-dsl for Linux environments.

Author

Takashi Kokubun

xremap's People

Contributors

k0kubun avatar hanachin avatar lostdj avatar yaa avatar waka avatar

Watchers

James Cloos avatar Ignacio Avas avatar

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.