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

Unity desktop entry not installed immediately after installation #6432

Closed
m3talsmith opened this issue May 17, 2016 · 15 comments
Closed

Unity desktop entry not installed immediately after installation #6432

m3talsmith opened this issue May 17, 2016 · 15 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug install-update VS Code installation and upgrade system issues linux Issues with VS Code on Linux verified Verification succeeded
Milestone

Comments

@m3talsmith
Copy link

m3talsmith commented May 17, 2016

Current Setup

  • VSCode Version: 1.1.1
  • OS Version: Ubuntu 16.04

Steps to Reproduce

  1. Install .deb
  2. Press super to bring up Unity Scope search
  3. Type code

Expected Result

  1. Visual Studio Code icon to appear
  2. Selecting icon should launch Visual Studio Code

Additional Notes

To conform with Unity launchers, many apps add a desktop entry into $HOME/.local/share/applications such as visual-studio-code.desktop:

[Desktop Entry]
Version=1.0
Type=Application
Name=Visual Studio Code
Icon=/usr/share/code/resources/app/resources/linux/code.png
Exec=/usr/bin/code
Comment=Visual Studio focused on modern web and cloud
Categories=Development;IDE;
Terminal=false

When installed through Ubuntu Make, this file is created although the Exec entry is wrong. When installed through the .deb downloaded from https://code.visualstudio.com, the file is not even created.

Attached is a working example of a correct entry appearing properly in the Unity Scope search:

expected-example

@Tyriar Tyriar self-assigned this May 17, 2016
@Tyriar
Copy link
Member

Tyriar commented May 17, 2016

/usr/share/applications/visual-studio-code.desktop is installed with the deb, I've found it takes unity some time to pick it up sometimes. Can you try restarting the PC or unity (alt+f2, type "unity", enter).

@Tyriar Tyriar added info-needed Issue requires more information from poster install-update VS Code installation and upgrade system issues linux Issues with VS Code on Linux labels May 17, 2016
@m3talsmith
Copy link
Author

Unity won't update right away if you put it in /usr/share/... but it will if it's put in the users home version of that: $HOME/.local/share/application/. Is there a reason for not placing it there?

@Tyriar
Copy link
Member

Tyriar commented May 17, 2016

The main reason it's there is because Chrome and Atom put it there. ~/.local/share/application/ all seem to be generated on my PC, are you sure you're meant to mess in that dir?

❯ ls ~/.local/share/applications/
chrome-apdfllckaahabafndbhieahigkjlhalf-Default.desktop
chrome-eempgbpnkjnacmilmobpbhbfpdjdcpgd-Default.desktop
chrome-fahmaaghhglfmonjliepjlchgpgfmobi-Default.desktop
code_-_alpha.desktop
mimeapps.list

@Tyriar
Copy link
Member

Tyriar commented May 17, 2016

Gnome says put it in /usr/share for all users and ~/.local/share for the single user.

Place this file in the /usr/share/applications directory so that it is accessible by everyone, or in ~/.local/share/applications if you only wish to make it accessible to a single user. Which is used should depend on whether your application is installed systemwide or into a user's home directory. GNOME monitors these directories for changes, so simply copying the file to the right location is enough to register it with the desktop.

Source: https://developer.gnome.org/integration-guide/stable/desktop-files.html.en

Seems like it's in the right place and it's actually an issue with gnome not watching correctly?

@m3talsmith
Copy link
Author

I'll uninstall and reinstall it to test.

@m3talsmith
Copy link
Author

m3talsmith commented May 17, 2016

Again, this is just the latest version downloaded, but here's the result:

m3talsmith@darkness-falling:~$ sudo dpkg -i ~/Downloads/vscode-amd64.deb 
(Reading database ... 226542 files and directories currently installed.)
Preparing to unpack .../Downloads/vscode-amd64.deb ...
update-alternatives: warning: alternative /usr/bin/code (part of link group editor) doesn't exist; removing from list of alternatives
Unpacking visual-studio-code (1.1.1-1463146452) over (1.1.1-1463146452) ...
Setting up visual-studio-code (1.1.1-1463146452) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.59ubuntu1) ...

m3talsmith@darkness-falling:~$ ll /usr/share/applications/
total 728
drwxr-xr-x   2 root root 12288 May 17 12:13 ./
drwxr-xr-x 303 root root 12288 May 17 12:12 ../
-rw-r--r--   1 root root   384 Mar  2 04:40 activity-log-manager.desktop
-rw-r--r--   1 root root   291 Apr 13 20:19 apport-gtk.desktop
-rw-r--r--   1 root root   125 Dec 16 03:08 apturl.desktop
-rw-r--r--   1 root root  7469 May 17 12:13 bamf-2.index
-rw-r--r--   1 root root   396 Jan 28 09:59 bluetooth-sendto.desktop
-rw-r--r--   1 root root   269 Jan 16 16:43 checkbox-converged.desktop
-rw-r--r--   1 root root   500 Apr  4 08:43 cheese.desktop
-rw-r--r--   1 root root 12559 Mar 24 14:32 chromium-browser.desktop
-rw-r--r--   1 root root   587 May 13 06:38 code.desktop
# ...

m3talsmith@darkness-falling:~$ ll ~/.local/share/applications/
total 212
drwx------  2 m3talsmith m3talsmith 4096 May 17 12:04 ./
drwx------ 17 m3talsmith m3talsmith 4096 May 17 12:09 ../
-rw-rw-r--  1 m3talsmith m3talsmith  252 May 15 13:28 mimeapps.list
-rw-rw-r--  1 m3talsmith m3talsmith  708 May 16 22:10 mimeinfo.cache
# ...

@Tyriar
Copy link
Member

Tyriar commented May 17, 2016

code.desktop is the one, forgot it uses the short name.

@m3talsmith
Copy link
Author

m3talsmith commented May 17, 2016

Right, so it does load it in /usr/share/applications/ for me, but not ~/.local/share/applications/

@m3talsmith
Copy link
Author

m3talsmith commented May 17, 2016

A restart of Unity does bring it into the scope search, but this isn't the expected way of having a scope.

@Tyriar
Copy link
Member

Tyriar commented May 17, 2016

Maybe the issue here is that it should be installed via desktop-file-install on Unity?

Once the file validates correctly, install it to the default location (probably /usr/share/applications) using the desktop-file-install program. This step may require superuser privileges.

https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_a_.desktop_file_to_the_Unity_Launcher

@Tyriar
Copy link
Member

Tyriar commented May 17, 2016

I just tested it, running sudo desktop-file-install /usr/share/applications/code.desktop immediately after install makes it show up in the scope search so to fix this issue I'll add that to the deb post install script.

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels May 17, 2016
@Tyriar Tyriar added this to the May 2016 milestone May 17, 2016
@m3talsmith
Copy link
Author

Thanks for that man! 💃

@Tyriar
Copy link
Member

Tyriar commented May 17, 2016

Thanks for reporting, it was a bit of an annoyance for me too :P

@Tyriar Tyriar closed this as completed in 833be74 May 18, 2016
@Tyriar
Copy link
Member

Tyriar commented May 18, 2016

@m3talsmith this will land in the May release (early June), thanks again! 🎆

@m3talsmith
Copy link
Author

Thanks for jumping on it so quickly @Tyriar !

@Tyriar Tyriar assigned aeschli and unassigned Tyriar May 23, 2016
@aeschli aeschli added the verified Verification succeeded label May 26, 2016
@Tyriar Tyriar changed the title Ubuntu scope not setup on installation Unity desktop entry not installed immediately after installation May 31, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
lemanschik pushed a commit to code-oss-dev/code that referenced this issue Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug install-update VS Code installation and upgrade system issues linux Issues with VS Code on Linux verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants