cascadium / wsl-windows-toolbar-launcher

Adds linux GUI application menu to a windows toolbar
MIT License
1.21k stars 50 forks source link

Failing #21

Closed ameeno closed 3 years ago

ameeno commented 4 years ago

Hello, this used to work before,

but it does not work on my current machine.

it creates folders in the .config folder on windows side, but crashes out.

here is the error:

user@Win10-Ryzen:~$ wsl-windows-toolbar -f /etc/xdg/menus/xfce-applications.menu
2020-10-08 11:32:20,544[INFO]: distribution = Ubuntu
2020-10-08 11:32:20,545[INFO]: user = user
2020-10-08 11:32:20,545[INFO]: confirm_yes = False
2020-10-08 11:32:20,545[INFO]: menu_file = /etc/xdg/menus/xfce-applications.menu
2020-10-08 11:32:20,545[INFO]: wsl_executable = C:\Windows\System32\wsl.exe
2020-10-08 11:32:20,545[INFO]: target_name = WSL
2020-10-08 11:32:20,545[INFO]: preferred_theme = Adwaita
2020-10-08 11:32:20,545[INFO]: alternative_theme = ('Papirus', 'Humanity', 'elementary-xfce')
2020-10-08 11:32:20,545[INFO]: jinja_template_batch = None
2020-10-08 11:32:20,545[INFO]: jinja_template_shell = None
2020-10-08 11:32:20,545[INFO]: rc_file = /home/user/.bashrc
2020-10-08 11:32:20,545[INFO]: has_imagemagick = True
2020-10-08 11:32:20,545[INFO]: has_cairosvg = True
2020-10-08 11:32:20,545[INFO]: launch_directory = /home/user
2020-10-08 11:32:20,560[INFO]: install_directory = /mnt/c/Users/User/.config/wsl-windows-toolbar-launcher/menus/WSL
2020-10-08 11:32:20,561[INFO]: metadata_directory = /mnt/c/Users/User/.config/wsl-windows-toolbar-launcher/metadata/WSL
2020-10-08 11:32:20,561[INFO]: For full list of options available, call script again with --help
2020-10-08 11:32:20,561[INFO]: This script will write to the above locations if it can, but giving final chance to chicken out.
Press <enter> to continue or ctrl+c to abort.
Traceback (most recent call last):
  File "/home/user/.local/bin/wsl-windows-toolbar", line 8, in <module>
    sys.exit(cli())
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/wsl_windows_toolbar/wsl_windows_toolbar.py", line 237, in cli
    menu = xdg.Menu.parse(menu_file.name)
  File "/home/user/.local/lib/python3.8/site-packages/xdg/Menu.py", line 1128, in parse
    return XMLMenuBuilder(debug).parse(filename)
  File "/home/user/.local/lib/python3.8/site-packages/xdg/Menu.py", line 632, in parse
    menu = self.parse_menu(tree.getroot(), filename)
  File "/home/user/.local/lib/python3.8/site-packages/xdg/Menu.py", line 650, in parse_menu
    self.parse_node(node, filename, menu)
  File "/home/user/.local/lib/python3.8/site-packages/xdg/Menu.py", line 659, in parse_node
    menu = self.parse_menu(child, filename)
  File "/home/user/.local/lib/python3.8/site-packages/xdg/Menu.py", line 650, in parse_menu
    self.parse_node(node, filename, menu)
  File "/home/user/.local/lib/python3.8/site-packages/xdg/Menu.py", line 682, in parse_node
    parent.Rules.append(self.parse_rule(child))
  File "/home/user/.local/lib/python3.8/site-packages/xdg/Menu.py", line 759, in parse_rule
    return Rule(type, tree)
  File "/home/user/.local/lib/python3.8/site-packages/xdg/Menu.py", line 421, in __init__
    self.code = compile(self.expression, '<compiled-menu-rule>', 'eval')
ValueError: Name node can't be used with 'True' constant
user@Win10-Ryzen:~$

Can you advise?

fquinner commented 4 years ago

Hmm, looks like some sort of bug in XDG which is the library that we use to parse the freedesktop submenu when running with newer Python versions:

https://gitlab.freedesktop.org/xdg/pyxdg/-/issues/20

What distro, ubuntu version etc are you running?

fquinner commented 3 years ago

Issue was fixed upstream so closing off here.