Giter Site home page Giter Site logo

mjolnir.tiling's Introduction

mjolnir.tiling

Add tiling window management powers to your mjolnir.

Features

  • Different layouts per space (with this magic)
  • Multi-monitor supported
  • Custom layouts

Quick start

First up, install Mjolnir if you haven't already.

Then install mjolnir.tiling using luarocks: luarocks install mjolnir.tiling

In your ~/.mjolnir/init.lua:

local tiling = require "mjolnir.tiling"
local mash = {"ctrl", "cmd"}

hotkey.bind(mash, "c", function() tiling.cyclelayout() end)
hotkey.bind(mash, "j", function() tiling.cycle(1) end)
hotkey.bind(mash, "k", function() tiling.cycle(-1) end)
hotkey.bind(mash, "space", function() tiling.promote() end)
hotkey.bind(mash, "f", function() tiling.gotolayout("fullscreen") end)

-- If you want to set the layouts that are enabled
tiling.set('layouts', {
  'fullscreen', 'main-vertical'
})

Updating

To update to the latest mjolnir.tiling, just run: luarocks install mjolnir.tiling

Using custom layouts

You can define your own layouts like so (please see layouts.lua for definition examples:)

tiling.addlayout('custom', function(windows)
  fnutils.each(windows, function(window)
    window:maximize()
  end)
end)

Floating Windows

Using tiling.togglefloat you can toggle whether or not a window that is on your desktop will be included in your tiling calculations. You can optionally pass in a function as a callback to process the window if it was tiled.

-- Push the window into the exact center of the screen
local function center(window)
  frame = window:screen():frame()
  frame.x = (frame.w / 2) - (frame.w / 4)
  frame.y = (frame.h / 2) - (frame.h / 4)
  frame.w = frame.w / 2
  frame.h = frame.h / 2
  window:setframe(frame)
end

hotkey.bind(mash, "f", function() tiling.togglefloat(center) end)

Layouts

These are the layouts that come with mjolnir.tiling:

Name Screenshot
fullscreen fullscreen
main-vertical main-vertical
main-horizontal main-horizontal
rows rows
columns columns
gp-vertical gp-vertical
gp-horizontal gp-horizontal

Contributing

Yes! Please :)

git clone https://github.com/nathankot/mjolnir.tiling.git
cd mjolnir.tiling
luarocks make <latest .rockspec name>

Contributors

Thanks <3

To-do

  • Better documentation
  • More layouts
  • Allow globally enabling/disabling layouts
  • Functions to move windows across spaces
  • Event-based tiling, although requires sdegutis/mjolnir#72

License

The MIT License (MIT)

Copyright (c) 2015 Nathan Kot

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

mjolnir.tiling's People

Contributors

acmcelwee avatar csaunders avatar iveney avatar jiblits avatar mavant avatar nathankot avatar orbaruk avatar peterjcaulfield avatar

Watchers

 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.