Code Monkey home page Code Monkey logo

Comments (10)

acrisci avatar acrisci commented on July 18, 2024

Oh ok put it in there then.

from i3ipc-python.

jcalbert avatar jcalbert commented on July 18, 2024

Looking closer, it seems that only get_workspaces() actually returns a visibility info.

This uses that function to fill in the relevant data, but it's hackish. Another option would be to just drop visible from the attribute docstring.

from i3ipc-python.

acrisci avatar acrisci commented on July 18, 2024

This uses that function to fill in the relevant data,

That won't work because the window can be hidden in a stack or by a floating window.

Another option would be to just drop visible from the attribute docstring.

Yeah that's probably best.

from i3ipc-python.

acrisci avatar acrisci commented on July 18, 2024

Search the i3 tracker for this. I think it's already been discussed. You'll have to fix this in i3 for me to support it.

from i3ipc-python.

sainathadapa avatar sainathadapa commented on July 18, 2024

@acrisci I looked for issues related to this on i3 repo, but couldn't find an issue that deals with exactly the current use case. Do you know if there is a way to filter for the list of containers which are 'visible' in a workspace?

from i3ipc-python.

acrisci avatar acrisci commented on July 18, 2024

You have to write it.

from i3ipc-python.

sainathadapa avatar sainathadapa commented on July 18, 2024

Understood, but I'm unable to infer that information in case of tabbed containers from the output of i3-msg -t get_tree. All the children of tabbed containers exist in the focus, and not just the visible one. Any ideas?

from i3ipc-python.

acrisci avatar acrisci commented on July 18, 2024

The first one in the list is on top.

from i3ipc-python.

jcalbert avatar jcalbert commented on July 18, 2024

@sainathadapa
get_tree doesn't have the ability to tell which containers are visible. You can have a look at my workaround here: here

key_list = ['urgent','focused','visible','inactive','off']

def init():
    states = {k:[] for k in key_list}
    states['off'].extend(range(1,19))

    js = i3.get_workspaces()

    for j in js:
        num = j['num']
        states['off'].remove(num)
        for k in key_list[:3]:
            if j[k]:
                states[k].append(num)
                break
        else:
            states['inactive'].append(num)

Basically, it uses get_workspaces to infer what containers are visible, active, etc. I don't think I've tested it with tabbed containers, though, so ymmv.

from i3ipc-python.

sainathadapa avatar sainathadapa commented on July 18, 2024

interesting, i'll try using both of your suggestions @acrisci @jcalbert and see if it works.

from i3ipc-python.

Related Issues (20)

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.