Giter VIP home page Giter VIP logo

i3-workspace-handler's Introduction

i3 Workspace Handler

Create i3 workspaces on the fly and call them by name.

dmenu screenshot

Pressing Mod+Space (on my setup I press in sequence left and right thumbs) a dmenu with the workspaces list appears, allowing to choose one.

Typing a non existing name a new one will be created.

With Mod+Shift+Space (left thumb, left pinkie, right thumb) you can move the selected container.

Installing

  • Copy lsws in a folder in your $PATH, or read below to see what it does.

  • Add these lines in your .i3/config:

bindsym $mod+space        exec i3-msg workspace $(lsws | dmenu -p "→")
bindsym $mod+Shift+space  exec i3-msg move container to workspace $(lsws | dmenu -p "|→")
bindsym $mod+u            workspace back_and_forth

Eventually changing them with your Mod key and your colors and font configuration.

Details

lsws

List workspaces. As seen before we need to get the workspace names list in a dmenu-friendly way, but i3-msg -t get_workspaces prints a json.

i3-msg -t get_workspaces |  # get the json
tr , '\n' |                 # replace commas with newline
grep name |                 # "name":"workspace-name"
cut -d \" -f 4              #         ^ 4th field, spliting by "

If you have it already installed you can use Jq to do the same job in a cleaner way:

i3-msg -t get_workspaces | jq -r ".[].name"

License

Licensed under the Beerware License:

As long as you retain this notice you can do whatever you want with this stuff.
If we meet some day, and you think this stuff is worth it, you can buy me a
beer in return.

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.