Giter Club home page Giter Club logo

tilingwindowmanager.spoon's Introduction

TilingWindowManager

macOS Tiling Window Manager. Spoon on top of Hammerspoon.

Example ~/.hammerspoon/init.lua configuration:

hs.loadSpoon("TilingWindowManager")
    :setLogLevel("debug")
    :bindHotkeys({
        tile =           {hyper, "t"},
        incMainRatio =   {hyper, "p"},
        decMainRatio =   {hyper, "o"},
        incMainWindows = {hyper, "i"},
        decMainWindows = {hyper, "u"},
        focusNext =      {hyper, "k"},
        focusPrev =      {hyper, "j"},
        swapNext =       {hyper, "l"},
        swapPrev =       {hyper, "h"},
        toggleFirst =    {hyper, "return"},
        tall =           {hyper, ","},
        talltwo =        {hyper, "m"},
        fullscreen =     {hyper, "."},
        wide =           {hyper, "-"},
        display =        {hyper, "d"},
    })
    :start({
        menubar = true,
        dynamic = true,
        layouts = {
            spoon.TilingWindowManager.layouts.fullscreen,
            spoon.TilingWindowManager.layouts.tall,
            spoon.TilingWindowManager.layouts.talltwo,
            spoon.TilingWindowManager.layouts.wide,
            spoon.TilingWindowManager.layouts.floating,
        },
        displayLayout = true,
        floatApps = {
            "com.apple.systempreferences",
            "com.apple.ActivityMonitor",
            "com.apple.Stickies",
        }
    })

API Overview

API Documentation

Variables

layouts
Signature TilingWindowManager.layouts
Type Variable
Description A table holding all known tiling layouts. Maps keys to descriptive strings. The strings show up in the user interface.

Functions

displayLayout
Signature TilingWindowManager.displayLayout() -> nil
Type Function
Description Shows an alert displaying the current spaces current layout.
Parameters
  • None
Returns
  • None
Notes
    focusRelative
    Signature TilingWindowManager.focusRelative(relativeIndex) -> nil
    Type Function
    Description Change window focus.
    Parameters
    • relativeIndex - positive moves focus next, negative moves focus previous.
    Returns
    • None
    Notes
    • Newly focussed window is determined by relative distance relativeIndex from current window in ordered tileable windows table. Wraps around if current window is first or last window.
    • +1 focuses next window, -1 focuses previous window.
    moveRelative
    Signature TilingWindowManager.moveRelative(relativeIndex) -> nil
    Type Function
    Description Moves window to different position in table of tileable windows.
    Parameters
    • relativeIndex - positive moves window next, negative moves window previous.
    Returns
    • None
    Notes
    • Wraps around if current window is first or last window.
    • Tiles the current space.
    swapFirst
    Signature TilingWindowManager.swapFirst() -> nil
    Type Function
    Description Swaps first window.
    Parameters
    • None
    Returns
    • None
    Notes
    • If current window is first window: Swaps window order and position with second window in tileable windows.
    • If current window is not first window: Swaps window order and position with first window in tileable windows.
    • Tiles the current space.
    toggleFirst
    Signature TilingWindowManager.toggleFirst() -> nil
    Type Function
    Description Toggles first window.
    Parameters
    • None
    Returns
    • None
    Notes
    • If current window is first window: Swaps window order and position with second window in tileable windows.
    • If current window is not first window: Makes current window the first window. Previous first window becomes the second window.
    • *Tiles the current space.

    Methods

    bindHotkeys
    Signature TilingWindowManager:bindHotkeys(mapping) -> self
    Type Method
    Description Binds hotkeys for TilingWindowManager
    Parameters
    • mapping - A table containing hotkey modifier/key details for the following items
    Returns
    • The TilingWindowManager object
    Notes
    • Keys for mapping:
    • - tile - Manually tiles the current macOS space.
    • - focusNext - move focus to next window.
    • - focusPrev - move focus to previous window.
    • - swapNext - swap current window with next window.
    • - swapPrev - swap current window with previous window.
    • - swapFirst - swap current window with first window.
    • - toggleFirst - Toggle current window with first window.
    • - float - switch current space to float layout.
    • - fullscreen - switch current space to fullscreen layout.
    • - tall - switch current space to tall layout.
    • - wide - switch current space to wide layout.
    • - display - display current space layout.
    setLogLevel
    Signature TilingWindowManager:setLogLevel(level) -> self
    Type Method
    Description Set the log level of the spoon logger.
    Parameters
    • Log level
    Returns
    • The TilingWindowManager object
    Notes
      start
      Signature TilingWindowManager:start([config]) -> self
      Type Method
      Description Starts TilingWindowManager spoon
      Parameters
      • config A table with configuration options for the spoon. These keys are recognized:
      dynamic - if true: dynamically tile windows.
      layouts - a table with all layouts to be enabled.
      fullscreenRightApps - a table with app names, to position right half only in fullscreen layout.
      floatApp - a table with app names to always float.
      displayLayout - if true: show layout when switching tiling layout.
      menubar - if true: enable menubar item.
      Returns
      • The TilingWindowManager object
      Notes
        stop
        Signature TilingWindowManager:stop() -> self
        Type Method
        Description Stops TilingWindowManager spoon
        Parameters
        • None
        Returns
        • The TilingWindowManager object
        Notes

          tilingwindowmanager.spoon's People

          Contributors

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