Giter Site home page Giter Site logo

i3-master-layout's Introduction

Simple master and stack layout script

| ------ | ----- |
|        |       |
| Master | Stack |
|        |       |
| ------ | ----- |
  • auto split 2nd window on workspace level to provide a vertical stack

  • put new windows at the end of the workspace tree

  • swap focused window with the master window (first window on current workspace tree) i3-swap-master.py

  • works independant from i3 state (no permanent marks required to keep track)

  • if master window disappears, get new master from stack (does only really work if you don't break the 2 column layout)

  • set master window width in percentage of your monitor

master-layout

Install

Install python 3 and install i3ipc libary

pip3 install i3ipc

Clone this repo and copy the scripts in any folder you like.

Example

git clone https://github.com/Hippo0o/i3-master-layout
cd i3-master-layout
cp i3-master-layout.py i3-swap-master.py i3-swallow-stack.py ~/.i3

Usage

bindsym $mod+r exec --no-startup-id $HOME/.i3/i3-swap-master.py

exec_always --no-startup-id $HOME/.i3/i3-master-layout.py

Options

$ ./i3-master-layout.py -h
Usage: i3-master-layout.py [options]

Options:
  -h, --help            show this help message and exit
  -e ws1,ws2,.. , --exclude-workspaces=ws1,ws2,.. 
                        List of workspaces that should be ignored.
  -o HDMI-0,DP-0,.. , --outputs=HDMI-0,DP-0,.. 
                        List of outputs that should be used instead of all.
  -s, --swap-new        Swap new windows with master.
  -n, --nested          Also move new windows which are created in nested
                        containers.
  -l LAYOUT, --stack-layout=LAYOUT
                        The stack layout. ("tabbed", "stacked", "splitv")
                        default: splitv
  --disable-rearrange   Disable the rearrangement of windows when the master
                        window disappears.

  -m 1..99, --mfact=1..99
                        Set width of the master window in percentage.

TODO

  • fix stack behaviour when master window is closed
  • make stack layout configurable (stacked, tabbed, splith, splitv)
  • fix stack layout "splith"
  • fix rearragement when master gets float window
  • maybe a focused based master selection (focused will get master automatically)

Swallow

Additionally there is a simple script i3-swallow-stack.py which enables a simple swallow mechanism by utilizing the stack/tabbed layout default to i3.

Options

$ ./i3-swallow-stack.py -h
usage: i3-swallow-stack.py [-h] [-d] [-t] cmd [cmd ...]

i3-swallow-stack

positional arguments:
  cmd         Command to be executed

options:
  -h, --help  show this help message and exit
  -d          Don't move window back to original parent on exit.
  -t          Use i3's tabbed layout instead of stack.

Tip: if a cmd needs to use the same flags run it like this ./i3-swallow-stack.py [-d] [-t] -- cmd [-d] [-t]

Example

./i3-swallow-stack.py feh ...

swallow

i3-master-layout's People

Contributors

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