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

sway/workspaces: sort by the "num" property provided by sway #696

Merged
merged 1 commit into from
May 6, 2020

Conversation

f0rki
Copy link
Contributor

@f0rki f0rki commented May 5, 2020

Sway provides the workspace "num" property which is an integer number of the workspace, i.e., workspace "3" -> 3 and also "3dev" -> 3. This PR uses this property to sort the workspaces, which makes sense when persistent workspaces or all-output is specified. This commit also adds a new configuration option, whether the numeric workspaces come in front or after workspaces that have non-numeric name.

…rable whether numeric workspace names come first

Sway provides the workspace "num" property which is an integer number of
the workspace, i.e., workspace "3" -> 3 and also "3dev" -> "3". This
commit uses this property to sort the workspaces, which makes sense when
persistent workspaces or all-output is specified. This commit also adds
a new configuration option, whether the numeric workspaces come in front
or after workspaces that have non-numeric name.
@Alexays
Copy link
Owner

Alexays commented May 6, 2020

Nice thanks!
Should be good for #482
Can you update the wiki?

@Alexays Alexays merged commit 0e869e3 into Alexays:master May 6, 2020
@f0rki f0rki deleted the sort_by_sway_num branch May 6, 2020 13:29
@f0rki
Copy link
Contributor Author

f0rki commented May 6, 2020

@Alexays sure I'll update the wiki

@imjasonmiller
Copy link

Given that this is fixed, I think I might have misconfigured something on my end?

sway version 1.4-5c32a484 (May 20 2020, branch 'master')
Waybar v0.9.2-140-g759602a (branch 'master')

sway/config

# Workspaces
set $ws1 1:Web
set $ws2 2:Code
set $ws3 3:Other
set $ws4 4:Media
set $ws5 5:Chat

waybar/config

"sway/workspaces": {
    "all-outputs": true,
    "format": " {name} ",
    "persistent_workspaces": {
        "1:Web": [],
        "2:Code": [],
        "3:Other": [],
        "4:Media": [],
        "5:Chat": []
    }
},

This gives me the following workspace order, where Web (1) is placed at the very end:

Waybar taskbar

Thank you for your time.

@f0rki
Copy link
Contributor Author

f0rki commented Jul 22, 2020

@imjasonmiller Hmm I think you have stumbled upon a rather strange bug. I tried to reproduce this in addition to my usual numeric workspaces. That did not work, but in a nested sway session I managed to reproduce, but strangely enough it only shows up if the "1:Web" (or "1:X" in my case) workspace is the first workspace that is focused...

When I launch sway and switch to X
20200722_15h17m18s_grim
20200722_15h17m38s_grim

However, when I launch sway and switch to C the ordering stays intact.
20200722_15h17m18s_grim
20200722_15h17m25s_grim
20200722_15h22m08s_grim

(the same issue with all other workspaces, such as "Z" or "B")

@f0rki
Copy link
Contributor Author

f0rki commented Jul 22, 2020

@imjasonmiller I think this might be the same issue as #777

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

Successfully merging this pull request may close these issues.

3 participants