-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
installed apps don’t show up in Ubuntu's "Show Applications" #1439
Comments
Could you share the output of $ ls ~/.nix-profile/share/applications ? |
Sure!
|
No idea if this is related but when I run a
|
I'm not using Gnome unfortunately. But you said that the launcher works if you call |
Ok, I did the following:
Then added
Then logging in and logging out I can see that I have all the apps in "Show Applications". So they actually have the same |
Update: it seems that in order to get rid of shortcuts after editing |
Update 2: Adding
to my |
I see, you only have |
Mm, I see. So I guess home-manager should still be adding some things to |
So I tried looking into this as well because for me home manager installed icons only work on NixOS but not on Arch. As you can see, I have the spotify icon in my For me restarts don't help. cloud $ echo $XDG_DATA_DIRS | string split ":"
/nix/var/nix/profiles/default/share
/home/cloud/.nix-profile/share
/home/cloud/.nix-profile/share
/home/cloud/.local/share/flatpak/exports/share
/var/lib/flatpak/exports/share
/usr/local/share
/usr/share
cloud $ fd . -t l ~/.nix-profile/share/icons/ | rg spotify
/home/cloud/.nix-profile/share/icons/hicolor/128x128/apps/spotify-client.png
/home/cloud/.nix-profile/share/icons/hicolor/16x16/apps/spotify-client.png
/home/cloud/.nix-profile/share/icons/hicolor/256x256/apps/spotify-client.png
/home/cloud/.nix-profile/share/icons/hicolor/32x32/apps/spotify-client.png
/home/cloud/.nix-profile/share/icons/hicolor/48x48/apps/spotify-client.png
/home/cloud/.nix-profile/share/icons/hicolor/512x512/apps/spotify-client.png
/home/cloud/.nix-profile/share/icons/hicolor/64x64/apps/spotify-client.png
|
This doesn't guarantee that your DE uses the same values. You could look in
Home manager calls |
That's a great tip, I didn't know about this. I took the parent process for
Indeed, the Home Manager file paths are missing here. I did some more specific googling and came upon a very interesting Gnome issue filed by a Guix user. On another tracker the issue has a solution and some more instructions specifically for distros like Arch which have this issue can be found here Unfortunately I couldn't make it work so far. I tried adding |
Me and @terlar was working with this issue for popOS (ubuntu based). the solution so far we found . setting home.nix like this. When the homeSession variables are passed to pamSession then the *.desktop files are found. Still couldn't fix the pop-shell launcher, desktop apps are not searchable by
|
Ok, I was able to reproduce what @samuela has done with Pop!_OS (@rajibahmed might be of your interest, as you are using the same OS). I did the following steps after a clean install:
I will try this on Fedora in a few weeks to confirm this is being reproduced as expected or if the same issue as @cideM happens (different behavior per distro) |
I tried the same steps on Fedora and it didn't work. I even tried to modify the So yes, this seems to change according to the distro being used, unfortunately. |
Did you try the |
Hey @terlar, just to confirm, it is adding My suspicion is the distro, or Wayland, because my current setup of pop!_OS uses Gnome on Xorg and with the tweak provided by @samuela, it worked without any issues. But on Fedora I am not able to get that. Had to use |
I am now running manjaro with wayland. PAM solution doesn't work with wayland I believe. |
I just had another look at this and got it to work with the following (for Ubuntu):
Together with this addition to
Caution! |
@terlar would you like to make a PR with all your recent |
I'm testing NixOS and I'm having a similar problem using GNOME. Apps won't appear in the Shell until I reset GNOME. |
This should fix the issue where desktops using Wayland did not see the installed desktop applications and potentially other artifacts stored in this directory. Suggested way to set per user environment variables for Wayland: https://wiki.archlinux.org/index.php/environment_variables#Per_user Fix nix-community#1439
This should fix the issue where desktops using Wayland did not see the installed desktop applications and potentially other artifacts stored in this directory. Suggested way to set per user environment variables for Wayland: https://wiki.archlinux.org/index.php/environment_variables#Per_user Fix nix-community#1439
This should fix the issue where desktops using Wayland did not see the installed desktop applications and potentially other artifacts stored in this directory. Suggested way to set per user environment variables for Wayland: https://wiki.archlinux.org/index.php/environment_variables#Per_user Fix nix-community#1439
This should fix the issue where desktops using Wayland did not see the installed desktop applications and potentially other artifacts stored in this directory. Suggested way to set per user environment variables for Wayland: https://wiki.archlinux.org/index.php/environment_variables#Per_user Fix nix-community#1439
This should fix the issue where desktops using Wayland did not see the installed desktop applications and potentially other artifacts stored in this directory. Suggested way to set per user environment variables for Wayland: https://wiki.archlinux.org/index.php/environment_variables#Per_user Fix nix-community#1439
May I know how to |
or simply append |
Even with |
This is fixing the issue:
Dumb, but working flawlessly. |
@samuela $ cat ~/.profile
export XDG_DATA_DIRS="/home/annymosse/.nix-profile/share:$XDG_DATA_DIRS"
$ echo $XDG_DATA_DIRS
/home/nixer/.nix-profile/share:/usr/share/plasma:/..... is there any idea ? |
@annymosse Using Ubuntu here as well, the solution I provided works fine ! I'm happy :) |
Thanks for your reply, however I'm trying to migrate into nix instead of |
Ah, this is a good question. Maybe someone else will help, I have no idea on how to implements this without using Home manager. |
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesDon't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
Tried on NixOS 22.11 in my home manager home.nix. Builds, but does nothing. Help appreciated, i really want my .nix-profile desktop entries to work... |
This ticket is about using home-manager on Ubuntu. If you're having problems on NixOS, you should open a separate issue, since desktop entries are managed very differently on NixOS. |
I'm using a variation of #1439 (comment) to also get icons/fonts/man/etc {
programs.bash = {
enable = true;
profileExtra = ''
export XDG_DATA_DIRS=$HOME/.home-manager-share:$XDG_DATA_DIRS
'';
};
home.activation = {
linkDesktopApplications = {
after = [ "writeBoundary" "createXdgUserDirectories" ];
before = [ ];
data = ''
rm -rf $HOME/.home-manager-share
mkdir -p $HOME/.home-manager-share
cp -Lr --no-preserve=mode,ownership ${config.home.homeDirectory}/.nix-profile/share/* $HOME/.home-manager-share
'';
};
};
} |
update: simpler, builtin version, of the above {
fonts.fontconfig.enable = true;
targets.genericLinux.enable = true;
home.activation = {
linkDesktopApplications = {
after = [ "writeBoundary" "createXdgUserDirectories" ];
before = [ ];
data = "/usr/bin/update-desktop-database";
};
};
} |
Thanks, @chaoky, that works for me! For anyone else trying to get this working, about not having file permissions to do this, but that was resolved by running: |
Tested around on Kubuntu (Nix installed with determinate systems installer), and I think you only need to Maybe In any case, for me, it seems like the Edit: for me, |
For Fedora Gnome, it works when you have |
Using: Kubuntu 23.04 w/ Nix Multiuser installation, here's what worked for me: Added the following to # As already mentioned
targets.genericLinux.enable = true;
xdg.mime.enable = true;
# The critical missing piece for me
xdg.systemDirs.data = [ "${config.home.homeDirectory}/.nix-profile/share/applications" ]; For whatever reason, that directory wasn't explicitly added to
|
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesDon't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
word of warning: I had installed |
Building on @drupol solution, my remaining issue was that the non-interactive shell did not seem to have the nix path so I added the nix path directly
I'm on gnome 45 on GeckoLinux (derivative of Opensuse Tumbleweed). I was unable to find how to make sure the non-interactive shell had the nix path. I would welcome making this less ugly by just adding the path instead of using sed |
Hey guys, anybody found a method by which we can use other shells like zsh in this context? I can add the XDG_DATA_DIRS=... line in ~/.profile and set user shell to bash using chsh -s /usr/bin/bash and after a reboot the applications show up in GNOME menu. But when I set shell to zsh, they disappear from menu. Any thoughts on what could be the issue here? I am on Debian 12 btw if that matters. |
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting. If you are the original author of the issue
If you are not the original author of the issue
Memorandum on closing issuesDon't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort. |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/apps-installed-via-home-manager-are-not-visible-within-gnome/48252/1 |
I'm not sure why but for me on Ubuntu adding # ~/.profile
if [ -e "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"; fi because of reasons I can't let HM manage bash so by adding this now both zsh and the |
Issue description
Apps installed via home-manager don't show up in the Ubuntu "Show Applications" thingy.
See https://discourse.nixos.org/t/home-manager-installed-apps-dont-show-up-in-applications-launcher/8523 for context. https://github.com/rycee/home-manager/blob/master/modules/misc/xdg-mime.nix suggests that home-manager should be adding these applications to the desktop manager database automatically, but for some reason it's not working. Note that running
update-desktop-database
manually on a copy of the relevant stuff in the nix store does work, as discussed in the Discourse thread.I have
targets.genericLinux.enable = true
and verified that$XDG_DATA_DIRS
is being set appropriately:Here's the entirety of my home.nix: https://gist.github.com/samuela/b507cb3a3effde6117b32700add2f448. I'm running Ubuntu 20.04.
Meta
Maintainer CC
@rycee @Kha
Technical details
The text was updated successfully, but these errors were encountered: