-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Gnome Activities icons should appear on app install #12757
Comments
You can also restart GNOME Shell with Alt+F2 and |
I never investigated this problem, but I believe the issue is with the fact that gnome shell watches xdg directories for changes, like ~/.nix-profile/share . However, that never changes in nix. What changes is ~/.nix-profile, hence gnome shell should watch whenever symlinks of profiles change rather than the contents of xdg directories. I'm not sure what needs to be patched, but certainly something must be done as it's an unpleasant experience. |
After a quick look, it seems that gnome shell uses GDesktopAppInfo for listing apps. To do this, of course GDesktopAppInfo doesn't scan all the .desktop files everytime, rather it watches xdg directories for changes using GFileMonitor: https://github.com/GNOME/glib/blob/master/gio/gdesktopappinfo.c I think this kind of approach is used by many desktops in general, not only GNOME, I wonder how it has been solved for e.g. kde or xfce. @ttuegel @vcunat do you know anything about this problem already? |
AFAIK, KDE doesn't use inotify for this, the directories are scanned at startup. |
@ttuegel and so how does it detect when a new app is installed? |
@lethalman It doesn't until you log out or call |
Interestingly it looked like some apps behave differently. When I installed 'atom' I had to restart to see it. When install gnome-tweak-tool, I was able to see it immediately. |
Probably because gnome-tweak-tool is installed by default, unless you disabled optional packages. :) |
ah. tricky |
triage: has this been fixed? |
@Profpatsch No, this has not been fixed. On a clean install with Gnome 3 enabled, this can be reproduced with:
After installing, one has to log out of the desktop and log back in. This is using a Gnome-Wayland session, btw. |
The KDE approach points to a way out: find the function in gnome-shell that gets called when the directory watchers ping it, and call it directly in the reload of the service. |
One more option that @emilazy pointed out but I only now understood, is to create a separate shadow XDG directories in e.g. |
I marked this as stale due to inactivity. → More info |
Unfortunately that does not work on Wayland (which is the default now). |
Guix has a patch for this: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/patches/glib-appinfo-watch.patch |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
Fixed by #118100 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/required-nix-gnome-tweaks-hacks/20711/2 |
#118100 only fixed this partially:
Upstream bug: https://gitlab.gnome.org/GNOME/glib/-/issues/144 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-make-home-packages-show-in-gnome-search/27748/3 |
This comment was marked as spam.
This comment was marked as spam.
AFAIR, you can search and launch immediately, but the icon will be missing until re-login (a generic placeholder icon is used instead). |
not on nixos though:( |
You sure? I just yesterday saw it working exactly as bjornfor described. After Seems to me that this issue is reduced to tracking an upstream bug as per the Apr. 30 comment. |
yeah, but i use nixos + home-manager (standalone, like to keep system and user separated). I wonder if that's the thing 🤔 |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
The ~/.nix-profile/share/application seems to update correctly when installing a new package, so I've written this temporary fix that automatically creates symlinks when the event fires. Inside home.nix home.activation.copyDesktopFiles = lib.hm.dag.entryAfter ["installPackages"] ''
if [ "$XDG_CURRENT_DESKTOP" = "GNOME" ]; then
if [ -d "${config.home.homeDirectory}/.nix-profile/share/applications" ]; then
rm -rf ${config.home.homeDirectory}/.local/share/applications
mkdir -p ${config.home.homeDirectory}/.local/share/applications
for file in ${config.home.homeDirectory}/.nix-profile/share/applications/*; do
ln -sf "$file" ${config.home.homeDirectory}/.local/share/applications/
done
fi
fi
''; |
Your script is the only thing that worked for me, thanks @Ceralex! |
I am using gnome3 in nixos. When I install an app in the console, I should be able to see it immediately in gnome's Activities. This is the case in ubuntu and arch when using gnome. In nix I have to logout and in in order to see the apps. Can this setup so I dont have to log out?
The text was updated successfully, but these errors were encountered: