Coder Social home page Coder Social logo

awesome-ezconfig's Introduction

awesome-ezconfig

Easier key and button setup for the Awesome tiling window manager. Inspired by Xmonad's EZConfig and Emacs's kbd function.

Usage

ezconfig = require('ezconfig')

-- Default configuration.  If you want different modkeys,
-- you'll need to recreate the whole table in your rc.lua.
ezconfig.modifier_keys = {
    ['M'] = "Mod4",
    ['A'] = "Mod1",
    ['S'] = "Shift",
    ['C'] = "Control",
}

globalkeys = ezconfig.keytable.join({
   ['M-<Left>'] = awful.tag.viewprev,
   ['M-S-j'] = {awful.client.swap.byidx, 1},
   ['M-C-k'] = {awful.screen.focus_relative, -1},
   ['M-m'] = function () menus.main:show() end,
})

-- The above is functionally equivalent to:
key = ezconfig.key
globalkeys = awful.util.table.join(
   key('M-<Left>', awful.tag.viewprev),
   key('M-S-j', {awful.client.swap.byidx, 1}),
)

-- Which is in turn equivalent to:
globalkeys = awful.util.table.join(
   awful.key({modkey}, 'Left', awful.tag.viewprev),
   awful.key({modkey, 'Shift'}, 'j', function () awful.client.swap.byidx(1) end),
)

-- It is also possible to configure mouse buttons:
clientbuttons = ezconfig.btntable.join({
   ['1'] = function (c) client.focus = c; c:raise() end,
   ['M-1'] = awful.mouse.client.move,
   ['M-3'] = awful.mouse.client.resize,
})

License

This lua module is licensed under the same terms as Awesome itself - the GNU GPLv2.

awesome-ezconfig's People

Contributors

gvalkov avatar

Watchers

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