infokiller / i3-workspace-groups

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

KeyError: 'enable' after i3-switch-active-workspace-group #27

Closed mb720 closed 4 years ago

mb720 commented 4 years ago

Hi!

Calling i3-switch-active-workspace-group produces a stacktrace:

Traceback (most recent call last):
  File "/usr/bin/i3-workspace-groups", line 253, in <module>
    main()
  File "/usr/bin/i3-workspace-groups", line 226, in main
    args.focused_monitor_only)
  File "/usr/lib/python3.7/site-packages/i3wsgroups/controller.py", line 168, in switch_active_group
    self.switch_monitor_active_group(monitor, target_group)
  File "/usr/lib/python3.7/site-packages/i3wsgroups/controller.py", line 150, in switch_monitor_active_group
    monitor_name)
  File "/usr/lib/python3.7/site-packages/i3wsgroups/controller.py", line 81, in organize_workspace_groups
    if self.config['icons']['enable'] and (
KeyError: 'enable'

Running i3-workspace-groups --log-level debug list-workspaces gives

2019-11-13 19:56:46,461 DEBUG [i3-workspace-groups:201] Using merged config:
{'icons': {'default_icon': '',
          'delimiter': '',
          '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}
2019-11-13 19:56:46,465 DEBUG [workspace_names.py:251] Workspace 201:​Work​:1​​ parsed as: {'global_number': 201, 'group': 'Work', 'static_name': '1', 'dynamic_name': '', 'local_number': None}
2019-11-13 19:56:46,465 DEBUG [workspace_names.py:251] Workspace 201:​Work​:2​​ parsed as: {'global_number': 201, 'group': 'Work', 'static_name': '2', 'dynamic_name': '', 'local_number': None}
2019-11-13 19:56:46,465 DEBUG [workspace_names.py:251] Workspace 201:​Work​:3​​ parsed as: {'global_number': 201, 'group': 'Work', 'static_name': '3', 'dynamic_name': '', 'local_number': None}
2019-11-13 19:56:46,466 DEBUG [workspace_names.py:251] Workspace 201:​Work​:4​​ parsed as: {'global_number': 201, 'group': 'Work', 'static_name': '4', 'dynamic_name': '', 'local_number': None}
2019-11-13 19:56:46,466 DEBUG [workspace_names.py:251] Workspace 301:​Rieju​:5​​ parsed as: {'global_number': 301, 'group': 'Rieju', 'static_name': '5', 'dynamic_name': '', 'local_number': None}
2019-11-13 19:56:46,466 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "journal_2019.md"
2019-11-13 19:56:46,466 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "/home/mb "
2019-11-13 19:56:46,466 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "/home/mb/config/vim_conf/.vim "
2019-11-13 19:56:46,466 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "Mutt with 1312 messages for Bull Bytes"
2019-11-13 19:56:46,466 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "assert local_number < _MAX_WORKSPACES_PER_GROUP TypeError: '<' not supported between instances of 'NoneType' and 'int' · Issue #25 · infokiller/i3-workspace-groups - Mozilla Firefox"
2019-11-13 19:56:46,466 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "slides_unit_06.tex"
2019-11-13 19:56:46,466 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "slides_unit_06.pdf"
2019-11-13 19:56:46,467 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "Patrick_Blackburn,_Johan_Bos,_Kristina_Striegnitz_Learn_Prolog_Now.pdf"
2019-11-13 19:56:46,467 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "descendants.pl"
2019-11-13 19:56:46,467 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "/home/mb/dev/prolog/hello_prolog "
2019-11-13 19:56:46,467 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "config"
2019-11-13 19:56:46,467 INFO [icons.py:50] No icon specified for window with class: "None", instance: "None", title: "None", name: "/home/mb "
201 Work    1           3x  201:​Work​:1​​  LVDS-1
201 Work    2              201:​Work​:2​​  LVDS-1
201 Work    3               201:​Work​:3​​  LVDS-1
201 Work    4           3x  201:​Work​:4​​  LVDS-1
301 Rieju   5               301:​Rieju​:5​​ LVDS-1
~$ 

Let me know if I can provide anything else.

infokiller commented 4 years ago

Hi, I think this should now be fixed, can you please try to update using: python3 -m pip install --pre --force-reinstall i3-workspace-groups and test it again?

mb720 commented 4 years ago

Amazing, thanks for fixing this so quickly!

infokiller commented 4 years ago

No problem, thanks for reporting these issues, and sorry for the rocky start!

mb720 commented 4 years ago

No worries! :-) I see this as a smooth ride given that I'm probably the first Sway user of i3-workspace-groups.