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

Question: how to get the last focused workspace name? #3569

Open
infokiller opened this Issue Dec 17, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@infokiller
Copy link

infokiller commented Dec 17, 2018

Hi,

I'm working on a project that uses the i3 IPC (https://github.com/infokiller/i3-workspace-groups).
Specifically, I'm now working on a feature for automatic workspace naming by the running apps. This causes an issue with the workspace back_and_forth command, since the last visited workspace may have changed its name since it was focused (because the running apps changed). Therefore, I'm implementing a wrapper of workspace back_and_forth that tries to detect these renamings and do the right thing.
Is there a way to get the last focused workspace name directly, without running the workspace back_and_forth command?
Alternatively, I tried to use marks to label the last focused workspace, but it doesn't seem to work. Is there a way to use marks on workspaces?

@i3bot

This comment has been minimized.

Copy link

i3bot commented Dec 17, 2018

I don’t see a version number. Could you please copy & paste the output of i3 --version into this issue?

@i3 i3 deleted a comment from i3bot Dec 17, 2018

@orestisf1993

This comment has been minimized.

Copy link
Member

orestisf1993 commented Dec 17, 2018

Alternatively, I tried to use marks to label the last focused workspace, but it doesn't seem to work. Is there a way to use marks on workspaces?

You can mark a workspace by selecting it with focus parent or by getting it's id through the ipc interface and then running [con_id=<id>] mark foo

@orestisf1993

This comment has been minimized.

Copy link
Member

orestisf1993 commented Dec 17, 2018

We could dump the previous workspace name like in 64ab1f4 for everyone

@infokiller

This comment has been minimized.

Copy link

infokiller commented Dec 17, 2018

Alternatively, I tried to use marks to label the last focused workspace, but it doesn't seem to work. Is there a way to use marks on workspaces?

You can mark a workspace by selecting it with focus parent or by getting it's id through the ipc interface and then running [con_id=<id>] mark foo

Thanks, that works for me!

@Airblader

This comment has been minimized.

Copy link
Member

Airblader commented Dec 17, 2018

Can't we use the focus_head for this? Is this dumped somehow? I can't access it at the moment so just a random idea.

@orestisf1993

This comment has been minimized.

Copy link
Member

orestisf1993 commented Dec 17, 2018

Without checking, I think this wouldn't work across multiple outputs.

@Airblader

This comment has been minimized.

Copy link
Member

Airblader commented Dec 17, 2018

Good point, even the focus head on that level wouldn't be enough to determine that. I wouldn't mind dumping the last workspace in any case as you suggested, though it seems not necessary anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment