2

Issues I had

  • Icons when launching via snap run <appname> were the default X icon, not the ones provided by snap
  • Trying to get OAuth working with things like Todoist (Google SSO in browser, redirect back to app) were broken, giving me an error about KIO Client not understanding the protocol.
  • Trying to use emulate sh -c 'source /etc/profile.d/apps-bin-path.sh' did not work in my ~/.zshrc
  • I was unwilling to use emulate sh -c 'source /etc/profile'
  • Adding snap to the bin path did not work in resolving anything
  • KRunner could not find snap-installed apps
  • Any launcher installed could not find snap-installed apps
  • Manually adding launchers to Latte Dock was buggy

2 Answers2

3

Okay, so no solutions actually worked for me. I had everything everyone else stated (adding to /etc/environment, the emulate command, everything).

I'm running Kubuntu 20.04 with ZSH. My solution is to synchronize your local applications folder with the snap folder.

As a script

Add this file to any folder that is part of your "bin" path. For me, I have ~/.local/bin, but you may have something else. Make sure what ever directory you use is part of your path variable. I added this file as ~/.local/bin/sync-snap-apps to my system.

#! /bin/zsh

shareApps="$HOME/.local/share/applications" snapApps="/var/lib/snapd/desktop/applications"

Detect all installed applications by snap

for file in $snapApps/*.desktop do

Get a not-ugly version of the .desktop

Example: todoist_todoist.desktop -> todoist.desktop

link="$shareApps/$(echo $file | cut -d '_' -f2)"

Create new link if none exists

[[ -f $link ]] || ln -s $file $link done

NOTE: Remove this if you do NOT want automatic broken symbolic link cleanup

for link in $shareApps/*.desktop; do

Remove any broken *.desktop symbolic links

[[ -e $link ]] || rm $link done

Now that this file is added to your system, append sync-snap-apps to the end of your ~/.zshrc and start up a new terminal. It will automatically sync up your snap applications.

As a zshrc addition

Put this at the bottom of your ~/.zshrc file

shareApps="$HOME/.local/share/applications"
snapApps="/var/lib/snapd/desktop/applications"

Detect all installed applications by snap

for file in $snapApps/*.desktop do

Get a not-ugly version of the .desktop

Example: todoist_todoist.desktop -> todoist.desktop

link="$shareApps/$(echo $file | cut -d '_' -f2)"

Create new link if none exists

[[ -f $link ]] || ln -s $file $link done

NOTE: Remove this if you do NOT want automatic broken symbolic link cleanup

for link in $shareApps/*.desktop; do

Remove any broken *.desktop symbolic links

[[ -e $link ]] || rm $link done


Final Notes

Note, this solved the following issues for me:

  1. Error KIO Client, I could not use Google Auth redirects to Snap applications, similar to this question and this github issue.
  2. Apps are not in launcher, similar to this reddit post and this question. Related to this forum post on SnapCraft.

The solution came from this answer, and is easier to understand than this answer on the same thread.

0

For me adding the mentioned emulate sh -c 'source /etc/profile.d/apps-bin-path.sh' to /etc/zsh/zprofile did the trick. (I am working with KUbuntu 23.10, zsh v5.9) This was replicated by someone else I suggested this to.

c11o
  • 1