Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Con.floating is None in sway #185

Open
tmarkov opened this issue Jul 25, 2021 · 5 comments
Open

Con.floating is None in sway #185

tmarkov opened this issue Jul 25, 2021 · 5 comments
Assignees
Labels

Comments

@tmarkov
Copy link

tmarkov commented Jul 25, 2021

i3ipc-python version: 2.2.1
sway: 1.6.1
python: 3.9.6

I run the following code:

from i3ipc import Connection, Event
i3 = Connection()
focused = i3.get_tree().find_focused()
print(focused.name) # gives proper name
print(focused.floating) # gives None

And the floating attribute is None (it's also None for the parents and I think all nodes on the tree).

@suconakh
Copy link

It seems that sway itself doesn't provide this field in swaymsg -t get_tree so it's not related to i3ipc-python.

@SpiritCroc
Copy link

Using window.type == "floating_con" seems to work as workaround for me

@ch3n9w
Copy link

ch3n9w commented Feb 19, 2023

@SpiritCroc May I ask how to get window.type in sway? as when I use i3ipc.Con#type(), it just give me a useless string "con".

@SpiritCroc
Copy link

@SpiritCroc May I ask how to get window.type in sway? as when I use i3ipc.Con#type(), it just give me a useless string "con".

When I do

i3ipc.Connection().get_tree().find_focused().type

I get con if my focused window is in normal tiled layout, and floating_con if it's floating. In my sway config I have

bindsym $mod+Shift+space floating toggle

to get a window to floating or back, which I used for testing.

@ch3n9w
Copy link

ch3n9w commented Feb 20, 2023

My bad, I always use tabbed mode in scratchpad, the tabbed window is con while its parent node is floating_con

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants