If you've encountered a strange issue where clicking the USB stick icon in the Unity Ubuntu taskbar opens Visual Studio Code (VS Code), you might be wondering how to change the default application back to the file explorer, Nemo. This article will provide you with a detailed explanation of the context topic and cover key concepts, including subtitles, paragraphs, and code blocks.
Context and Issue
The Unity desktop environment, which was previously the default desktop environment in Ubuntu, has been replaced by GNOME since Ubuntu 17.10. However, some users still prefer using Unity or have applications that work better with it. When you plug in a USB stick, an icon typically appears in the Unity launcher, which you can click to open the file explorer and view the contents of the USB stick.
However, if you have VS Code installed and associated with a particular file type or MIME type associated with removable devices, clicking the USB stick icon might open VS Code instead of the file explorer. This behavior can be confusing, especially if you were unaware of the MIME type association.
MIME Types and File Associations
MIME types are used to identify file types and their associated applications. MIME types are identified by a unique identifier, such as "application/pdf" for PDF files or "inode/directory" for directories. The system uses these MIME types to decide which application to use when opening a file or, in this case, when a user clicks an icon representing a removable device.
Changing the Default Application
To change the default application for a specific MIME type, you can follow these steps:
Launch the "Settings" application by clicking the icon at the top-right corner of the screen and searching for "Settings" in the Dash.
In the Settings application, click "Details" on the left side, and then click "Mime Types" in the right pane. This will display the list of MIME types.
Locate the MIME type associated with removable devices, which should have an identifier similar to "inode/directory". Click it to view the current default application.
In the "Default Application" dropdown menu, select the desired application, which is "Nemo" in this case. Once you've changed the default application, click the "Close" button.
Updating MIME Type Associations for VS Code
If you want to ensure that VS Code does not interfere with the MIME type associations in the future, you can follow these steps:
Launch the "Settings" application by clicking the icon at the top-right corner of the screen and searching for "Settings" in the Dash.
Click "Editors" on the left side of the screen and then click "File Associations" on the right side.
Verify that there are no MIME types or file extensions associated with removable devices, such as "*.directory" or "*".
In this article, we covered the strange issue of clicking the USB stick icon in the Unity taskbar opening VS Code and how to revert the default application back to Nemo. We provided a detailed explanation of the context topic, including key concepts related to MIME types and file associations. We also provided a step-by-step guide on changing the default application for a specific MIME type and verifying the file associations for VS Code.
References
"MIME Types and File Associations" https://developer.gnome.org/glib/stable/glib-mime-types.html
"Switch from GNOME back to Unity on Ubuntu 17.10" https://itsfoss.com/unity-17-10/
"VS Code File Associations" https://code.visualstudio.com/docs/setup/linux#_file-associations