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

IndexError: list index out of range #8

Open
rstcruzo opened this issue Apr 19, 2017 · 2 comments
Open

IndexError: list index out of range #8

rstcruzo opened this issue Apr 19, 2017 · 2 comments

Comments

@rstcruzo
Copy link

When I run i3-hud-menu.py I get this error:

Window id is : 0x2600007
Traceback (most recent call last):
  File ".scripts/i3-hud-menu.py", line 168, in <module>
    try_gtk_interface(gtk_bus_name_cmd, gtk_object_path_cmd)
  File ".scripts/i3-hud-menu.py", line 81, in try_gtk_interface
    gtk_bus_name = gtk_bus_name_cmd.split(' ')[2].split('\n')[0].split('"')[1]
IndexError: list index out of range

Service is running and .profiles is set according to documentation.

@florentcigolotti
Copy link

I got the same error and I added a print to see the content of gtk_bus_name_cmd just before the if at line 165. And the content was _GTK_UNIQUE_BUS_NAME: no such atom on any window.. So the code is trying to parse something that is not it expects.
And if you look at the differents Pull requests, they all added another condition in the if line 165 to handle this case.
So, if you have the same error, try to add or gtk_bus_name_cmd == '_GTK_UNIQUE_BUS_NAME: no such atom on any window.\n' in the condition.
Get a look at pull requests content.

@jneidel
Copy link

jneidel commented Jul 13, 2018

Had the same problem, as advised by @florentcigolotti I followed the pull request #7 and replaced the if statement on line 165 of i3-hud-menu.py with:

if (gtk_bus_name_cmd == '_GTK_UNIQUE_BUS_NAME:  not found.\n' or
    gtk_object_path_cmd == '_GTK_MENUBAR_OBJECT_PATH:  not found.\n' or
    gtk_bus_name_cmd == '_GTK_UNIQUE_BUS_NAME:  no such atom on any window.\n'):

Everything works fine now.

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

No branches or pull requests

3 participants