-
-
Notifications
You must be signed in to change notification settings - Fork 44
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 #191
base: master
Are you sure you want to change the base?
Sway workspaces #191
Conversation
- sort workspaces number from sway to show them in correct order - fix configuration interface - handle workspaces labels in config - handle workspaces labels from sway if not defined in config
86eddfe
to
de94b6b
Compare
if num in self.settings["numbers"]: | ||
config_idx = self.settings["numbers"].index(num) | ||
elif len(self.settings["numbers"]) == 0: | ||
config_idx = num - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
settings["numbers"]
is stored as a list of str, int-based lookup fails here
text = labels[config_idx] | ||
elif labels and len(labels) == 1: | ||
text = labels[0] | ||
elif idx in range(len(ws_defs)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default value of ws_defs
is None, which has no len()
ws_num, win_name, win_id, non_empty, win_layout, numbers, ws_defs = self.find_details() | ||
|
||
custom_labels = self.settings["custom-labels"] | ||
focused_labels = self.settings["focused-labels"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not accessed
ws_num, win_name, win_id, non_empty, win_layout, numbers, ws_defs = self.find_details() | ||
|
||
custom_labels = self.settings["custom-labels"] | ||
focused_labels = self.settings["focused-labels"] | ||
|
||
if len(self.settings["numbers"]) > 0: | ||
numbers = self.settings["numbers"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if numbers is set in config, it's not guaranteed to match ws_defs
Thank you, @moetayuko |
if focused: | ||
labels = self.settings["focused-labels"] | ||
else: | ||
labels = self.settings["custom-labels"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previously it fallbacks to custom-labels if focused-labels not defined, need to implement this as well.
split from #188 and rebased on master at https://github.com/MoetaYuko/nwg-panel/tree/sway-workspaces, and addressed the issues I commented above. please test if its behavior is still desired. I noticed the following issues with both my rebased branch and @mildred 's original branch
"sway-workspaces": {
"numbers": [],
"custom-labels": [],
"focused-labels": [],
"hide-empty": true,
"hide-other-outputs": true
}, in the following example, 368 are non-empty at nwg-panel start time so they occur first, 14 are switched to later so they come after 368, which is undesired. need to reimplement the mapping between ws number and gtk.label |
I don't use this module in real life, and the code contains some contributed changes not always in line with my original concept. It would be better if further changes would be discussed by real life users. |
Fixes #189 and #190