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 |
Also, when I try to run an app, I get a permission denied and I'm unable to run the app. |
@berbiche : I also tried your solution:
|
@drupol you may solve your issue by checking out your permissions on your |
Actually, I have this, I don't see where the problem is. It looks like I have the permissions, but for some reason, it doesn't work. ~ ls -la ~/.local/share/applications
lrwxrwxrwx 44 devlin 20 Apr 12:25 home-manager -> /home/devlin/.nix-profile/share/applications
.rw-rw-r-- 0 devlin 28 Feb 13:57 mimeapps.list
.rw-rw-r-- 1.0k devlin 25 Mar 09:42 mimeinfo.cache
~ ls -la ~/.local/share/
drwxrwxr-x - devlin 20 Apr 12:25 applications
drwxrwxr-x - devlin 23 Mar 13:17 ark
drwxrwxr-x - devlin 1 Oct 2020 backintime
drwxrwxr-x - devlin 11 Oct 2021 baloo
drwxrwxr-x - devlin 4 Jun 2021 composer
drwxr-xr-x - devlin 28 Sep 2020 discover
drwxrwxr-x - devlin 20 Apr 10:46 dolphin
drwx------ - devlin 20 Apr 12:55 fish
drwxr-xr-x - devlin 28 Sep 2020 flatpak
drwxrwxr-x - devlin 28 Sep 2020 fonts
drwx------ - devlin 15 Apr 14:42 gvfs-metadata
drwxrwxr-x - devlin 14 Jun 2021 gwenview
drwxr-xr-x - devlin 3 Feb 14:31 home-manager
drwxrwxr-x - devlin 17 Nov 2020 ibus-table
dr-xr-xr-x - devlin 8 Feb 15:42 icons
drwxrwxr-x - devlin 4 Feb 14:25 JetBrains
drwxrwxr-x - devlin 28 Sep 2020 kactivitymanagerd
drwxrwxr-x - devlin 22 Feb 09:01 kate
drwxrwxr-x - devlin 20 Apr 12:50 kcookiejar
drwxrwxr-x - devlin 29 Sep 2020 kded5
drwx------ - devlin 9 Feb 12:40 keyrings
drwxrwxr-x - devlin 11 Jun 2021 khelpcenter
drwxrwxr-x - devlin 20 Apr 14:14 klipper
drwxrwxr-x - devlin 28 Sep 2020 knewstuff3
drwxrwxr-x - devlin 8 Feb 15:15 konsole
drwxrwxr-x - devlin 9 Mar 12:58 krdc
.rw------- 2.2k devlin 20 Apr 11:11 krunnerstaterc
drwxrwxr-x - devlin 28 Mar 13:07 kscreen
drwxrwxr-x - devlin 6 Apr 17:15 ksysguard
drwxrwxr-x - devlin 20 Apr 08:38 kwalletd
drwxrwxr-x - devlin 3 May 2021 kxmlgui5
drwx------ - devlin 18 Oct 2021 mime
.rw-rw-r-- 0 devlin 3 Feb 22:20 mimeapps.list
drwx------ - devlin 3 Feb 17:18 nano
drwxr-xr-x - devlin 3 Mar 16:45 nix
drwxrwxr-x - devlin 7 Jun 2021 okular
drwxrwxr-x - devlin 28 Sep 2020 omf
drwxrwxr-x - devlin 21 Jun 2021 plasma_notes
drwxrwxr-x - devlin 20 Apr 13:52 RecentDocuments
.rw------- 9.2k devlin 15 Apr 14:41 recently-used.xbel
drwxr-x--- - devlin 3 Nov 2020 remmina
drwxrwxr-x - devlin 28 Sep 2020 sddm
drwxrwxr-x - devlin 3 Nov 2020 teamviewer15
drwx------ - devlin 20 Apr 11:11 TelegramDesktop
drwxrwxr-x - devlin 20 Apr 12:59 Trash
.rw-rw-r-- 4.8k devlin 18 Oct 2021 user-places.xbel
.rw-rw-r-- 4.8k devlin 18 Oct 2021 user-places.xbel.bak
.rw-rw-r-- 0 devlin 18 Oct 2021 user-places.xbel.tbcache
drwxrwxr-x - devlin 3 Jun 2021 vinagre
~ ls -la ~/.local
drwxrwxr-x - devlin 18 Mar 10:24 bin
drwxrwxr-x - devlin 20 Apr 11:11 share
~ ls -la ~/.local/share
drwxrwxr-x - devlin 20 Apr 12:25 applications
drwxrwxr-x - devlin 23 Mar 13:17 ark
drwxrwxr-x - devlin 1 Oct 2020 backintime
drwxrwxr-x - devlin 11 Oct 2021 baloo
drwxrwxr-x - devlin 4 Jun 2021 composer
drwxr-xr-x - devlin 28 Sep 2020 discover
drwxrwxr-x - devlin 20 Apr 10:46 dolphin
drwx------ - devlin 20 Apr 12:55 fish
drwxr-xr-x - devlin 28 Sep 2020 flatpak
drwxrwxr-x - devlin 28 Sep 2020 fonts
drwx------ - devlin 15 Apr 14:42 gvfs-metadata
drwxrwxr-x - devlin 14 Jun 2021 gwenview
drwxr-xr-x - devlin 3 Feb 14:31 home-manager
drwxrwxr-x - devlin 17 Nov 2020 ibus-table
dr-xr-xr-x - devlin 8 Feb 15:42 icons
drwxrwxr-x - devlin 4 Feb 14:25 JetBrains
drwxrwxr-x - devlin 28 Sep 2020 kactivitymanagerd
drwxrwxr-x - devlin 22 Feb 09:01 kate
drwxrwxr-x - devlin 20 Apr 12:50 kcookiejar
drwxrwxr-x - devlin 29 Sep 2020 kded5
drwx------ - devlin 9 Feb 12:40 keyrings
drwxrwxr-x - devlin 11 Jun 2021 khelpcenter
drwxrwxr-x - devlin 20 Apr 14:14 klipper
drwxrwxr-x - devlin 28 Sep 2020 knewstuff3
drwxrwxr-x - devlin 8 Feb 15:15 konsole
drwxrwxr-x - devlin 9 Mar 12:58 krdc
.rw------- 2.2k devlin 20 Apr 11:11 krunnerstaterc
drwxrwxr-x - devlin 28 Mar 13:07 kscreen
drwxrwxr-x - devlin 6 Apr 17:15 ksysguard
drwxrwxr-x - devlin 20 Apr 08:38 kwalletd
drwxrwxr-x - devlin 3 May 2021 kxmlgui5
drwx------ - devlin 18 Oct 2021 mime
.rw-rw-r-- 0 devlin 3 Feb 22:20 mimeapps.list
drwx------ - devlin 3 Feb 17:18 nano
drwxr-xr-x - devlin 3 Mar 16:45 nix
drwxrwxr-x - devlin 7 Jun 2021 okular
drwxrwxr-x - devlin 28 Sep 2020 omf
drwxrwxr-x - devlin 21 Jun 2021 plasma_notes
drwxrwxr-x - devlin 20 Apr 13:52 RecentDocuments
.rw------- 9.2k devlin 15 Apr 14:41 recently-used.xbel
drwxr-x--- - devlin 3 Nov 2020 remmina
drwxrwxr-x - devlin 28 Sep 2020 sddm
drwxrwxr-x - devlin 3 Nov 2020 teamviewer15
drwx------ - devlin 20 Apr 11:11 TelegramDesktop
drwxrwxr-x - devlin 20 Apr 12:59 Trash
.rw-rw-r-- 4.8k devlin 18 Oct 2021 user-places.xbel
.rw-rw-r-- 4.8k devlin 18 Oct 2021 user-places.xbel.bak
.rw-rw-r-- 0 devlin 18 Oct 2021 user-places.xbel.tbcache
drwxrwxr-x - devlin 3 Jun 2021 vinagre
~ ls -la ~/.local/share/applications
lrwxrwxrwx 44 devlin 20 Apr 12:25 home-manager -> /home/devlin/.nix-profile/share/applications
.rw-rw-r-- 0 devlin 28 Feb 13:57 mimeapps.list
.rw-rw-r-- 1.0k devlin 25 Mar 09:42 mimeinfo.cache
~ ls -la ~/.nix-profile/
dr-xr-xr-x - devlin 1 Jan 1970 bin
lrwxrwxrwx 70 devlin 1 Jan 1970 datagrip -> /nix/store/g19v4kd038dv65ndc7sc018pjs9rl927-home-manager-path/datagrip
dr-xr-xr-x - devlin 1 Jan 1970 etc
lrwxrwxrwx 69 devlin 1 Jan 1970 include -> /nix/store/g19v4kd038dv65ndc7sc018pjs9rl927-home-manager-path/include
dr-xr-xr-x - devlin 1 Jan 1970 lib
dr-xr-xr-x - devlin 1 Jan 1970 libexec
lrwxrwxrwx 60 devlin 1 Jan 1970 manifest.nix -> /nix/store/d7aaxkdg7bmm23xjlb7xmh1zafglq0c3-env-manifest.nix
lrwxrwxrwx 65 devlin 1 Jan 1970 opt -> /nix/store/g19v4kd038dv65ndc7sc018pjs9rl927-home-manager-path/opt
lrwxrwxrwx 70 devlin 1 Jan 1970 phpstorm -> /nix/store/g19v4kd038dv65ndc7sc018pjs9rl927-home-manager-path/phpstorm
lrwxrwxrwx 66 devlin 1 Jan 1970 sbin -> /nix/store/g19v4kd038dv65ndc7sc018pjs9rl927-home-manager-path/sbin
dr-xr-xr-x - devlin 1 Jan 1970 share
$ |
home.activation = {
linkDesktopApplications = {
after = [ "writeBoundary" "createXdgUserDirectories" ];
before = [ ];
data = ''
+ [ -e ${config.xdg.dataHome}/"applications/home-manager" ] && \
+ rm -f ${config.xdg.dataHome}/"applications/home-manager"
ln -s ${config.home.homeDirectory}/.nix-profile/share/applications \
${config.xdg.dataHome}/"applications/home-manager"
'';
};
}; |
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. |
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: