infokiller / i3-workspace-groups

Manage i3wm workspaces in groups
MIT License
222 stars 15 forks source link

Workspace 1 - inconsistent behavior #35

Closed tigerjack closed 4 years ago

tigerjack commented 4 years ago

Whenever I start i3, workspace number 1 is automatically shown. However, if I use the usual $sup + 1 to switch to workspace 1, another workspace with the same number pops up, as clear from the figure.

image

Those are the relevant lines of the i3 config file.

# bindsym $sup+1 workspace 1
set $exec_i3_groups exec --no-startup-id i3-workspace-groups
bindsym $sup+1 $exec_i3_groups workspace-number 1

Any clue on what's happening?

EDIT: Of course, without i3-workspace-groups, the behaviour is consistent. Also, I know that I'm not using the library at all here. Still, I prefer to use the "normal" behaviour in most cases, while switching to the power of groups only in specific circumstances.

EDIT2: pip shows that I have version 0.4.6 (latest).

infokiller commented 4 years ago

i3-workspace-groups should work normally when you only use a single group (as if you used vanilla i3). Can you please the full output of i3-workspace-groups --log-level debug list-workspaces? The issue will likely be fixed if you run i3-workspace-groups switch-active-group '' (run it before you have the issue with the duplicate workspace)

tigerjack commented 4 years ago

i3-workspace-groups should work normally when you only use a single group (as if you used vanilla i3). Exactly, but unfortunately that's not what's happening for me. Can you please the full output of i3-workspace-groups --log-level debug list-workspaces?

Here it is. Indeed the two workspaces have different static and dynamic names.

2020-09-09 10:51:16,289 DEBUG [i3-workspace-groups:201] Using merged config:
{'icons': {'default_icon': '',
           'delimiter': '',
           'enable': False,
           'enable_all_groups': False,
           'min_duplicates_count': 3,
           'rules': [{'icon': '\ue795',
                      'match': 'kitty|Termite|URxvtc?',
                      'property': 'class'},
                     {'icon': '\ue743',
                      'match': 'Chromium|Chrome',
                      'property': 'class'},
                     {'icon': '\ue745',
                      'match': 'Firefox',
                      'property': 'class'},
                     {'icon': '\uf0ea', 'match': 'copyq', 'property': 'class'},
                     {'icon': '\ue5fe', 'match': 'Ranger', 'property': 'class'},
                     {'icon': '\uf120', 'match': 'Rofi', 'property': 'class'},
                     {'icon': '\ue244', 'match': 'Pqiv', 'property': 'class'},
                     {'icon': '\ue22b', 'match': 'Pinta', 'property': 'class'},
                     {'icon': '\uf008', 'match': '[Mm]pv', 'property': 'class'},
                     {'icon': '嗢', 'match': '[Vv]lc', 'property': 'class'},
                     {'icon': '\uf1c2',
                      'match': '[Ll]ibreoffice-writer',
                      'property': 'class'},
                     {'icon': '\uf1c3',
                      'match': '[Ll]ibreoffice-calc',
                      'property': 'class'},
                     {'icon': '\uf03d', 'match': 'Peek', 'property': 'class'},
                     {'icon': '\ue235',
                      'match': 'ipython',
                      'property': 'class'},
                     {'icon': '\ue235', 'match': 'python', 'property': 'class'},
                     {'icon': '\ue235',
                      'match': 'jupyter-qtconsole',
                      'property': 'class'},
                     {'icon': '\ue7c5', 'match': 'Gvim', 'property': 'class'},
                     {'icon': '\uf013',
                      'match': 'settings',
                      'property': 'class'},
                     {'icon': '聆', 'match': 'slack', 'property': 'class'},
                     {'icon': '\uf725',
                      'match': 'Zathura',
                      'property': 'class'},
                     {'icon': '\ue215',
                      'match': 'Telegram',
                      'property': 'class'},
                     {'icon': '墳',
                      'match': 'Pavucontrol',
                      'property': 'class'}],
           'try_fallback_rules': True},
 'renumber_workspaces': False}
2020-09-09 10:51:16,296 DEBUG [workspace_names.py:251] Workspace 1:​​​​1 parsed as: {'global_number': 1, 'group': '', 'static_name': '', 'dynamic_name': '', 'local_number': 1}
2020-09-09 10:51:16,296 DEBUG [workspace_names.py:251] Workspace 1 parsed as: {'global_number': None, 'group': '', 'static_name': '1', 'dynamic_name': None, 'local_number': None}
2020-09-09 10:51:16,296 DEBUG [workspace_names.py:251] Workspace 2:​​​​2 parsed as: {'global_number': 2, 'group': '', 'static_name': '', 'dynamic_name': '', 'local_number': 2}
2020-09-09 10:51:16,296 DEBUG [workspace_names.py:251] Workspace 10:​​​​10 parsed as: {'global_number': 10, 'group': '', 'static_name': '', 'dynamic_name': '', 'local_number': 10}
2020-09-09 10:51:16,296 INFO [icons.py:47] No icon specified for window with class: "firefox", instance: "Navigator", title: "Workspace 1 - inconsistent behavior · Issue #35 · infokiller/i3-workspace-groups - Mozilla Firefox", name: "Workspace 1 - inconsistent behavior · Issue #35 · infokiller/i3-workspace-groups - Mozilla Firefox"
2020-09-09 10:51:16,297 INFO [icons.py:47] No icon specified for window with class: "firefox", instance: "Navigator", title: "politecnico di milano software - Google Search - Mozilla Firefox", name: "politecnico di milano software - Google Search - Mozilla Firefox"
2020-09-09 10:51:16,297 INFO [icons.py:47] No icon specified for window with class: "Emacs", instance: "emacs", title: "emacs@hp255g6", name: "emacs@hp255g6"
2020-09-09 10:51:16,297 INFO [icons.py:47] No icon specified for window with class: "Zotero", instance: "Navigator", title: "Zotero", name: "Zotero"
2020-09-09 10:51:16,297 INFO [icons.py:47] No icon specified for window with class: "Thunderbird", instance: "Mail", title: "Inbox - Polimi - Mozilla Thunderbird", name: "Inbox - Polimi - Mozilla Thunderbird"
1               1       1:​​​​1 eDP
        1              1   eDP
2               2   4x   2:​​​​2 eDP
10              10      10:​​​​10   eDP

The issue will likely be fixed if you run i3-workspace-groups switch-active-group '' (run it before you have the issue with the duplicate workspace)

I'm not sure I understood it correctly. Do you mean, run it every time before launching i3?

infokiller commented 4 years ago

The issue will likely be fixed if you run i3-workspace-groups switch-active-group '' (run it before you have the issue with the duplicate workspace)

I'm not sure I understood it correctly. Do you mean, run it every time before launching i3?

You shouldn't need to run this if your config has the i3-workspace-groups commands as documented in the README. Did you start i3 with the i3-workspace-groups commands already in the config, or did you only add them after starting i3?

Can you please verify if the issue is fixed if you run i3-workspace-groups switch-active-group '' followed by closing one of the duplicate 1 workspaces?

tigerjack commented 4 years ago

@infokiller yep the configuration for the main commands is pretty much the same. Also, I can fix the error even without running the command. Indeed, when i3 starts, I am in workspace 1. However, if I don't have any window opened in this workspace and I press $sup+1, another workspace 1 opens up and the previous one just disappear. On the other hand, if some window is opened in the original workspace 1, it does not disappear, but I can access it just using sup+p or $sup+n.

infokiller commented 4 years ago

Did using i3-workspace-groups switch-active-group '' (and then getting rid of the first workspace) work? If so, what you can do is add to your i3 config exec --no-startup-id i3-workspace-groups switch-active-group ''. Alternatively, if you are interested in having window icons in your config, you can add exec --no-startup-id i3-autoname-workspaces, which will spawn a daemon that automatically adds window icons to the workspace names.

tigerjack commented 4 years ago

Different scenarios tried:

I'll try the icon suggestion, but anyway I think that there is some kind of bug somewhere.

infokiller commented 4 years ago

Thanks for the detailed description! Just to clarify: the fact you see a workspace named 1:1 is not a bug, it's the intended behavior. If you want to see it only as 1, you need to add strip_workspace_numbers yes to your i3bar config as documented in the README.

What is the buggy behavior here is that you have the 1 workspace in addition to the 1:1 one, instead of only having 1:1.

But, if you run i3-workspace-groups switch-active-group '' after you start i3, without creating any other workspaces and without opening any window, it should work. Can you confirm this? If that's the case, if you add exec --no-startup-id i3-workspace-groups switch-active-group '', and then work normally, you shouldn't hit that bug.

infokiller commented 4 years ago

Closing because I can't reproduce, please re-open if you get back to this.