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] Load themes from XDG_DATA_DIRS #1617

Closed
2 tasks done
sagikazarmark opened this issue Apr 11, 2022 · 11 comments · Fixed by #1619
Closed
2 tasks done

[REQUEST] Load themes from XDG_DATA_DIRS #1617

sagikazarmark opened this issue Apr 11, 2022 · 11 comments · Fixed by #1619

Comments

@sagikazarmark
Copy link

sagikazarmark commented Apr 11, 2022

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?

When installing themes as packages (using OS package manager), packages might not always end up in /usr (eg. in case of NixOS). As a result, Rofi won't find themes installed as packages.

By adding XDG_DATA_DIRS to the list of search paths (install dir, XDG_DATA_DIRS, XDG_DATA_HOME, XDG_CONFIG_HOME), Rofi could find themes in other (standard) locations.

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

Tried to install themes using Nix and they are not discovered. Also checked the relevant code.

Who will benefit from it?

NixOS users will certainly will benefit, but anyone else who installs software in non-standard locations would also benefit.

Rofi version (rofi -v)

1.7.3

Configuration

N/A

Additional information

As far as I understood, it should be added above this line:

char *theme_path = g_build_filename(THEME_DIR, filename, NULL);

@DaveDavenport
Copy link
Collaborator

This was not done as themes might not be backwards compatible. So if you have multiple versions of rofi installed (f.e. in /usr from dist and /usr/local by hand) it should find the matching themes of the install, not all.

@sagikazarmark
Copy link
Author

I see. Well, that should really up to be the package manager, isn't it? I mean most package managers can handle conflicts.

But I understand that not all installations might happen via a package manager.

How about an optional setting then (eg. env var) that either enables searching in XDG_DATA_DIRS or accepts a list of additional paths to search in?

This was not done as themes might not be backwards compatible.

On that note: is there a test command in rofi to make sure a given theme is compatible with it? It would help build scripts/CI determine if a set of themes can be packaged for a specific rofi version.

@DaveDavenport
Copy link
Collaborator

The themes seem to be stabilizing after we moved to the new engine a few years back and deprecating the old format.
Maybe we do not need to do this anymore.

(rofi -rasi-validate exists, but only check if it parses.)

@sagikazarmark
Copy link
Author

Do you want me to draft a PR adding XDG_DATA_DIRS to the search paths?

rofi -rasi-validate exists, but only check if it parses

Is there anything else necessary to ensure the theme is valid and will work?

@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Apr 12, 2022

Currently i don't think so, the major changes are done. its now more adding features (like tab-stop) and the language constructs for it. so the -rasi-validate should be sufficient.

@DaveDavenport
Copy link
Collaborator

I think that should do it?

@sagikazarmark
Copy link
Author

Looks good, thanks!

I'll give it a try later.

@DaveDavenport
Copy link
Collaborator

Did it work?

@sagikazarmark
Copy link
Author

sagikazarmark commented Apr 16, 2022

Yeah, it worked.

@DaveDavenport
Copy link
Collaborator

thanks.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants