How to restore missing Snap apps to the GDE app drawer after moving to Zsh from Bash.

I recently decided to unify my shell environment across Ubuntu and macOS systems to improve my experience switching operating systems while working on cross-platform projects.

An unfortunate side-effect was that the switch from bash to z-shell in Ubuntu broke my app drawer — no apps installed via Snap showed up in the GUI at all. They totally disappeared from the app drawer, and my favorites in the menu / toolbar disappeared. Using VS Code, for example, required me to launch it from the command line, which wasn’t great.

The Fix

It looks like there are two scripts that are sourced by Bash by default that export environment variables which tell Wayland and Flatpak where to find and load the GUI applications.

Here’s how to restore them to your Zsh environment:

1. edit your zprofile:

sudo (vim, nano, vi) /etc/zsh/zprofile

2. Add these two lines to the end of the profile to ensure Zsh is sourcing the env vars that lets wayland find your snap apps:

emulate sh -c ‘source /etc/profile.d/apps-bin-path.sh’
emulate sh -c ‘source /etc/profile.d/flatpak.s

3. save your edited zprofile

4. reboot your machine

sudo shutdown -r now

Checking The Fix

Upon reboot, open your app drawer and see that your Snap /flatpack apps are restored. As a note: some other solutions were out there about exporting various XDG_(something) variables in ~/.zshrc — none of that worked, only this worked at the system level, which makes some sense since it is exported before the user is logged in.

Major credit to to this handy write-up, which was the source of the fix I have summarized here.

(originally published on Medium March 4th 2021)
Note: All content in this post was produced using Ubuntu 20.04 LTS

Total
0
Shares
Previous Post

Change your number but keep your old one using Google Voice.

Next Post

Kassandra: AR for all macs, now in Public Beta