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

[REQUEST] Allow optional imports #2078

Open
2 tasks done
agorgl opened this issue Jan 8, 2025 · 0 comments
Open
2 tasks done

[REQUEST] Allow optional imports #2078

agorgl opened this issue Jan 8, 2025 · 0 comments

Comments

@agorgl
Copy link

agorgl commented Jan 8, 2025

Before opening a feature request

  • I checked the next branch to see if the feature has already been implemented
  • I searched existing reports to see if it is already requested.

What is the user problem or growth opportunity you want to see solved?

It would be nice if rofi had some functionality for optional imports.
This would allow for dynamic configuration to play nicely with static (fallback) configuration.

Lets say you have some program dynamically generating extra configuration for rofi.
Currently if you have your main rofi configuration just @import it, it will work, but it would fail in cases this extra (optional) configuration is missing.

Example snippet:

//
// ~/.config/rofi/config.rasi
//

// Default configuration copied for example purposes
configuration {

    // Timeout from user input.
    timeout {
        // The delay after inactivity to execute action.
        delay: 0;
        // The action to execute once the delay expires.
        action: "kb-cancel";
    }

    // File browser mode.
    filebrowser {
        sorting-method:    "name";
        directories-first: true;
    }
}

// Default theme gets imported here
@theme "default"

// Optional overrides file gets imported here
@import? "overrides"

In this example, having some kind of optional import directive (i'm suggesting an @import? directive for this) would allow for the override.rasi to be loaded if it exists, else just continue/fallback to the previously defined configuration.

How do you know that this problem exists today? Why is this important?

It allows rofi to be more flexible when configuring it with dynamically generated sources/imports.

Who will benefit from it?

Everybody

Rofi version (rofi -v)

1.7.7

Configuration

.

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant