linkfrg / ignis

Full-featured Python framework for building desktop shells using GTK4
https://linkfrg.github.io/ignis/
GNU General Public License v3.0
13 stars 1 forks source link

Error in services/hyprland.py #3

Open A31Nesta opened 1 month ago

A31Nesta commented 1 month ago

Loading this hyprland configuration (dotfiles) loads a wallpaper but no bar, launcher or any other kind of window.

I'm using arch linux, hyprland-git and ignis (not -git, as specified in the dotfiles' wiki).

The issue could be related to the error that appears in the log:

json.decoder.JSONDecodeError: Expecting ',' delimiter: line 146 column 3 (char 4096)

caused by running the __sync_kb_layout function. This occurs in the configuration of the dotfiles linked above in line 4 of modules/bar/workspaces.py when Service.get("hyprland") is run.

Error log:
ignis.log

Things I tried:

By the way, running meson install -C build to install ignis installs everything in /usr/local, meaning that to use it you need to either manually copy the files to /usr or include usr/local to the path. Not a big deal but it could be a good idea to mention it in the wiki.

linkfrg commented 1 month ago

Strange, I can't reproduce it. Have you tried installing non-git version of Hyprland?

linkfrg commented 1 month ago

ignis-git currently not building due to the post_install.py script, python bytecode compiles without problems, but the VERSION file is not written to /usr/lib/python3.12/ignis/ since this directory does not yet exist when the script is launched. For some reason it is trying to write this file to the real root and not to the fakeroot

linkfrg commented 1 month ago

ignis-git builds without errors after ec8c5bd and 55ffb9c

A31Nesta commented 1 month ago

Strange, I can't reproduce it. Have you tried installing non-git version of Hyprland?

I just tried and it worked correctly, the only thing that doesn't seem to work is the settings menu. ~The log says it can't be found. I tried opening it manually with ignis --open ignis_SETTINGS but it didn't work. Opening another window like ignis_POWERMENU did work~ Ok ignore that last line, it was the namespace but it's never opened like that in the files. This seems more related to the dotfiles, should I open an issue there?

Here's the log: ignis.log (The error line about the window not being found is there because I tried opening it manually via command line)

linkfrg commented 1 month ago

The settings menu can be opened by clicking on the gear button in the control panel, near powermenu button.

linkfrg commented 1 month ago

In GTK, if you destroy a window (close it with Ctrl+C in my dotfiles) and open it again, you will get a warning and will not be able to close it again in the same way. Therefore, the settings window is initialized anew each time.

A31Nesta commented 1 month ago

The settings menu can be opened by clicking on the gear button in the control panel, near powermenu button.

Yeah, I know, just like in the previous version of your configuration. It still doesn't work for me. The logs are not saying anything either. The power button does work

A31Nesta commented 1 month ago

Opening ignis (normal, not git) with the debug flag does give me this error when trying to open the settings:

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/ignis/widgets/button.py", line 39, in <lambda>
    self.connect("clicked", lambda x: self.on_click(x) if self.on_click else None)
                                      ^^^^^^^^^^^^^^^^
  File "/home/a31nesta/.config/ignis/modules/control_center/user.py", line 50, in <lambda>
    on_click=lambda x: settings_window(),
                       ^^^^^^^^^^^^^^^^^
  File "/home/a31nesta/.config/ignis/modules/settings/__init__.py", line 77, in settings_window
    child=settings_widget(),
          ^^^^^^^^^^^^^^^^^
  File "/home/a31nesta/.config/ignis/modules/settings/__init__.py", line 53, in settings_widget
    user_entry(active_page),
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/a31nesta/.config/ignis/modules/settings/user.py", line 34, in user_entry
    FileRow(
  File "/home/a31nesta/.config/ignis/modules/settings/elements/filerow.py", line 13, in __init__
    self._button = Widget.FileChooserButton(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ignis/widgets/file_chooser_button.py", line 68, in __init__
    self.__sync(self.dialog.initial_path)
  File "/usr/lib/python3.12/site-packages/ignis/widgets/file_chooser_button.py", line 89, in __sync
    self.__file_icon.icon_name = Utils.get_file_icon_name(path, symbolic=True)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/ignis/utils/get_file_icon_name.py", line 17, in get_file_icon_name
    file.query_info("standard::icon", Gio.FileQueryInfoFlags.NONE)
gi.repository.GLib.GError: g-io-error-quark: Error when getting information for file “/var/lib/AccountsService/icons/a31nesta”: No such file or directory (1)

I don't have an icon for my user so that's most likely what is causing the issue. In my opinion it's more of a problem with the dotfiles but not with ignis itself (though it's probably a good idea to log the error to the file). I'm going to set an icon for my user and see what happens

Edit: Yes, that was it. Setting a user icon fixes the issue

linkfrg commented 1 month ago
  1. debug flag currently don't print really useful information xD
  2. Problem in ignis, i need to make a try-except block to handle this exception in Utils.get_file_icon_name(), also need to add standart user avatar if /var/lib/AccountsService/icons/a31nesta doesn't exist.

Edit: I tried to delete /var/lib/AccountsService/icons/a31nesta and remove "user_avatar" option in ~/.cache/ignis/options.json, got the same error. Strange but the exception was not logged by logger

linkfrg commented 1 month ago

should be fixed after c4b8c1d. Dotfiles needs to be updated as I have made some breaking changes to ignis, I'll try to do it today or tomorrow