JonnyHaystack / i3-resurrect

Simple solution to saving and restoring i3 workspaces
GNU General Public License v3.0
369 stars 18 forks source link

Support for saving and restoring workspaces by number #52

Closed takinoy closed 4 years ago

takinoy commented 4 years ago

This pull request allow selecting workspace by number.

When a number is provided to --workspace option, the workspace that match the corresponding number is selected. It work's for save and restore commands.

JonnyHaystack commented 4 years ago

Other than the minor comments I've left, I have another concern. This change makes it so if the workspace name is numeric, it will match the first workspace is in the tree with that number. This prompts me to ask the following question: What if the first "num" match is not the closest "name" match? Consider the following scenario:

So it may be necessary to have an option to specify numeric mode. Maybe something like i3-resurrect save -n -w 10. That way it will behave like i3-msg workspace number N only when people want it to, and otherwise would still work as expected.

takinoy commented 4 years ago

@JonnyHaystack Yes I'm aware about this behavior. I have considered to add extra option but thinking to avoid unnecessary extra complexity. Your proposal to add -n option like save -n -w 10 seem to be good to avoid confusion

JonnyHaystack commented 4 years ago

Okay I can put that option in when I do the merge then. Thanks!