GithubHelp home page GithubHelp logo

xmonadengineerlayout's Introduction

Engineer Layout

An XMonad layout for fine-grained customisation. It allows you to set pre-defined layouts for when a specific group of windows is present on the workspace. Window categories and how to categorise them is left up to you to define.

Example: example all layouts

Instalation

Download the EngineerLayout.hs file in this repo (or clone everything) and place that file inside your xmonad lib directory (~.xmonad/lib/)

โš  Warning

While hot reloading a modified config you need to press mod+shift+space to see changes

Example config

  1. Define the datatype for window categories. It needs to derive Show Ord Eq and Read
import EngineerLayout

data ProgramType = Discord
                 | Emacs
                 | Browser
                 | Terminal
                 | Other deriving (Show, Ord, Eq, Read)
  1. Create the windowFunction, which has the window categorization logic
  • the function type here is windowFunction MyWindowFn :: (Window) -> X ProgramType) alter the instance according to your datatype and name MyWindowFnwhatever you like.
  • look here for querying other window properties beyond appName
  • use xprop to find out window properties of the apps you use.
data MyWindowFn = MyWindowFn deriving(Show,Read)
instance WindowFn MyWindowFn ProgramType where
  windowFunction _ =
    runQuery (pickProgram <$> appName)
    where
      pickProgram "discord" = Discord
      pickProgram "emacs" = Emacs
      pickProgram "google-chrome" = Browser
      pickProgram "qutebrowser" = Browser
      pickProgram "kitty" = Terminal
      pickProgram _ = Other
  1. Use the layout, declaring where to place windows in various combinations and at the end, giving a default layout if the categories are different.
myLayout = Engineer MyWindowFn
    [ [ (Discord, RationalRect (2%12) (1%12) (8%12) (10%12))]
    , [ (Browser, RationalRect (3%20) 0 (7%10) 1)]
    , [ (Browser,RationalRect (4%10) 0 (6%10) 1)
      , (Discord,RationalRect 0 0 (4%10) 1)
      ]
    , [ (Emacs, RationalRect (3%12) (1%48) (6%12) (46%48))]
    , [ (Emacs, RationalRect (1%50) (1%50) (23%50) (48%50))
      , (Emacs, RationalRect (26%50) (1%50) (23%50) (48%50))
    ]
    , [ (Terminal, RationalRect (3%12) (10%48) (6%12) (24%48))]
    ] (GridRatio 1.5)

Example Result

Browser

[ (Browser, RationalRect (3%20) 0 (7%10) 1)]

My layout for Browser

Discord

[ (Discord, RationalRect (2%12) (1%12) (8%12) (10%12))]

Result layout for Discord

Browser and Discord

[ (Browser,RationalRect (4%10) 0 (6%10) 1)
, (Discord,RationalRect 0 0 (4%10) 1)
]

Result layout for Browser and Discord

One Emacs

[ (Emacs, RationalRect (3%12) (1%48) (6%12) (46%48))]

Result layout for Emacs

Two Emacs

[ (Emacs, RationalRect (1%50) (1%50) (23%50) (48%50))
, (Emacs, RationalRect (26%50) (1%50) (23%50) (48%50))
]

Result layout for two emacs

Terminal

[ (Terminal, RationalRect (3%12) (10%48) (6%12) (24%48))]

Result layout for Browser

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.