Git Product home page Git Product logo

tabs_are_windows's Introduction

This repository documents my setup for qutebrowser and i3 that combines qb's tabs.tabs_are_windows option with i3's tabbed layout. The main advantages of this setup are that tabs can be moved freely to different workspaces or put side-by-side, without having to reload them (such as with tab-give). And the tabs can be mixed with other applications such as a PDF-reader.

On the other hand, tabs_are_windows has several shortcomings, many of which I have circumvented with some more or less hacky solutions:

  1. Focusing tabs: Obviously, qb's commands to switch tabs don't work on i3 tabs. Instead, you can use i3's bindings. Due to muscle memory, I have also bound the following in qb itself:

     config.bind(']', 'spawn ~/.local/share/i3/window-tool tab-focus next')
     config.bind('[', 'spawn ~/.local/share/i3/window-tool tab-focus prev')
     config.bind('}', 'spawn ~/.local/share/i3/window-tool tab-move next')
     config.bind('{', 'spawn ~/.local/share/i3/window-tool tab-move prev')
    

    Here, I'm using a script from my i3-tools, but of course, you could simply use i3-msg focus right etc.

  2. Closing the last tab: To simulate the setting tabs.last_close = 'default-page', which keeps a qb window open when the last tab is closed, I use the userscript tab-close in this repo (requires jq). It's not perfect though, especially with respect to undo.

     config.bind('q', 'spawn --userscript tab-close')
    
  3. Background tabs: qb has no control over whether i3 focuses a newly created tab, so all new tabs will open in the foreground. This can be circumvented by a hack that sets the WM_WINDOW_ROLE of background tabs differently (see here). Then, you can tell i3 to not focus these tabs when they open:

     no_focus [window_role="^qutebrowser_background$"]
    

    Instead of patching qb directly, I added a horrible monkey patch to config.py.

  4. Tabbing new windows: I use an i3 workspace layout and a custom desktop file to open new qb windows in a tabbed layout, but only if the current workspace is empty. See the script, layout and desktop file qutebrowser-layout.* (requires jq).

  5. Favicons: In the very freshest builds of i3, you can even show favicons in the tab bar! You just need to enable it in i3's config.

     for_window [class=".*"] title_window_icon on
    
  6. Always showing the tab bar: Since I disable i3's title bars in regular windows, a tabbed container with a single child will not display a tab bar either. My feature request to make this configurable was rejected, so I had no choice but to patch i3 myself to always show a tab bar in a tabbed container. See the file i3_patch.

    As a bonus, the patch does the opposite for stacked containers: It never shows the titlebar, kind of like herbstluftwm's maximized layout. I mostly use this to hide a terminal that launches a gui app behind that app's window. And I was never using the old stacked layout anyway.

  7. Opening qb tabs from other applications: If another application opens a qb window, it will open next to that instead of with the existing tabs, which is not always what I want. This can be circumvented by telling i3 to open all new qb windows on a given workspace, but I chose not to do that, since sometimes it's preferable to keep the new window where it is. Instead, I simply made a binding:

     config.bind('z', 'spawn i3-msg move container to workspace 2, workspace 2')
    

tabs_are_windows's People

Contributors

miseran avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

bkuri

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.