Skip to content

Had to fix after re-install #10

@zabeiua

Description

@zabeiua

I've reinstalled my CachyOS and after installing flux ignis it was failing to start. Only wallpaper was showing up on "ignis init". I've prompted gemini-cli to fix and it succeeded. Here is the summary of what it did, it might help in further development ;)

✦ To fix the ignis init failure and get Flux running, I identified and resolved two main issues: a variable naming mismatch between the Python color library and the SCSS styles, and an initialization order
problem.

Root Cause Analysis

  1. Variable Mismatch: The materialyoucolor library generates color keys in camelCase (e.g., secondaryPaletteKeyColor), but the SCSS files (specifically workspaces.scss) and templates were expecting
    snake_case (e.g., $secondary_paletteKeyColor). This caused the Sass compiler to crash because the variable didn't exist in the dictionary passed to it.
  2. Initialization Order: In config.py, the CSS was being applied before the MaterialService (the part that generates colors from your wallpaper) was fully initialized. This meant that on the first run, the
    color dictionary was empty, leading to the "Undefined variable" error.

Changes Made
I applied the following surgical fixes to your configuration:

  1. services/material/service.py:
    • Updated get_colors_from_img to automatically generate snake_case aliases for all "PaletteKeyColor" variables. This ensures compatibility with any SCSS file or template that uses the _paletteKeyColor
      format.
  2. config.py:
    • Moved the initialization of MaterialService to the top of the file, before css_manager.apply_css. This guarantees that if colors are missing, they are generated from the wallpaper before the shell
      tries to compile the SCSS.
  3. styles/workspaces.scss:
    • Updated the specific line causing the crash to use $secondaryPaletteKeyColor, aligning it with the standard naming convention used elsewhere in the project.

How to reproduce/verify later
If you ever reset your configuration and encounter a similar "Undefined variable" error:

  1. Check ~/.cache/ignis/material/colors.scss to see if the variable is actually being generated.
  2. Verify that MaterialService.get_default() is called in your config.py before any css_manager calls.
  3. Ensure your SCSS variable names match the keys generated in MaterialService.get_colors_from_img.

The shell should now start correctly, and you should see the bar and widgets appearing over your wallpaper.

Topic: Summarizing the successful fix of ignis init and the Flux shell startup issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions