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
rofi: NixOS drun desktop entry paths fixed #92264
base: master
Are you sure you want to change the base?
Conversation
I don't think you should remove searching to $XDG_DATA_DIRS/applications. The patch should make rofi look additionally to the profile. Also maybe it's better to use $XDG_CONFIG_HOME to find the profile, but I'm not a xdg specialist. |
Got back the $XDG_DATA_DIRS/applications, now walking threw all NIX_PROFILES with /share/applications suffix |
It does work to find desktop files, but not their icons. |
Now icons from <nix_every_profile>/share/icons> are fetched. Should work for most icons. |
Added <nix_every_profile>/share/pixmaps> (to make it work with discord and maybe other apps). |
That's a large patch. What about adding a wrapper which add $NIX_PROFILES to $XDG_DATA_DIRS instead ? |
Replaced the big patch with wrapProgram and substituteInPlace. |
496dd22
to
b616061
Compare
I marked this as stale due to inactivity. → More info |
I marked this as stale due to inactivity. → More info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think XDG_DATA_DIRS must be patched at package level, but should be solved at OS level (or HomeManager-level on non-NixOS), because it's not only rofi that has a problem with data dirs, but potentially all graphical apps (that use icons, fonts, ...).
@@ -58,13 +59,18 @@ stdenv.mkDerivation rec { | |||
which | |||
]; | |||
|
|||
postInstall = '' | |||
wrapProgram $out/bin/rofi \ | |||
--run 'export XDG_DATA_DIRS="$(sed "s| |/share:|g" < <(echo $NIX_PROFILES))/share:$XDG_DATA_DIRS"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you expect to have in $NIX_PROFILES
from inside the build sandbox ?
Will it work in all cases? (NixOS, non-NixOS, ...)
Motivation for this change
rofi didn't show any entry with drun modi.
Things done
Patched it to fetch the /run/current-system/sw/share/applications and ~/.nix-profile/share/applications desktop entries.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)