ubuntu / snapcraft-desktop-helpers

Various launchers for snapcraft wiki parts
MIT License
73 stars 60 forks source link

None of the snap symlink the home folders #153

Open dietmarw opened 6 years ago

dietmarw commented 6 years ago

Based on the discussion in https://forum.snapcraft.io/t/none-of-the-snap-symlink-the-home-folders/7273 I'm filing this as an issue here.

On my machine none of the snaps manage to symlink the desktop folders and generate error messages like:

ln: failed to create symbolic link '/home/dietmarw/snap/gnome-calculator/222/snap/gnome-calculator/222/Documents': No such file or directory

Here the trace for gnome-calculator as an example: https://paste.ubuntu.com/p/HrjvZ97x2Y/

oSoMoN commented 6 years ago

The contents of /home/dietmarw/snap/gnome-calculator/222/.config/user-dirs.dirs don't look right. The value of XDG_DOCUMENTS_DIR should be "/home/dietmarw/Documents", not "/home/dietmarw/snap/gnome-calculator/222/Documents". Can you delete that file, run the application again and share the contents of the file after it's been recreated?

dietmarw commented 6 years ago

After deletion and running gnome-calculator again I get the same content:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
oSoMoN commented 6 years ago

Are these the contents of /home/dietmarw/.config/user-dirs.dirs or /home/dietmarw/snap/gnome-calculator/current/.config/user-dirs.dirs ?

dietmarw commented 6 years ago

The latter:

~$ cat snap/gnome-calculator/current/.config/user-dirs.dirs 
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"
XDG_PICTURES_DIR="$HOME/Pictures"
XDG_VIDEOS_DIR="$HOME/Videos"
oSoMoN commented 6 years ago

This doesn't look right, there must be a problem with the code that writes user-dirs.dirs.

This has been reported separately here: https://forum.snapcraft.io/t/snap-apps-are-not-starting/7590.

dietmarw commented 6 years ago

So is there any workaround I can do before this gets fixed in desktop-exports?

kenvandine commented 6 years ago

@oSoMoN Maybe it's the line above that, where it calls can_open_file on both of those files.

Do you have $HOME/.config/user-dirs.locale and $HOME/.config/user-dirs.dirs ?

dietmarw commented 6 years ago

In my case there is only a $HOME/.config/user-dirs.dirs

oSoMoN commented 6 years ago

@dietmarw can you please share the contents of your $HOME/.config/user-dirs.dirs ?

dietmarw commented 6 years ago

@oSoMoN

~$ cat $HOME/.config/user-dirs.dirs
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_PUBLICSHARE_DIR="$HOME/Dropbox/Public"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_MUSIC_DIR="$HOME/Music"
XDG_VIDEOS_DIR="$HOME/Videos"
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOCUMENTS_DIR="$HOME/"
XDG_TEMPLATES_DIR="$HOME/.local/templates"
XDG_PICTURES_DIR="$HOME/Bilder"
urbandroid commented 5 years ago

output snap shell cat $HOME/.config/user-dirs.dirs

XDG_DESKTOP_DIR="$HOME/Desktop" XDG_DOWNLOAD_DIR="$HOME/Downloads" XDG_TEMPLATES_DIR="$HOME/Templates" XDG_PUBLICSHARE_DIR="$HOME/Public" XDG_DOCUMENTS_DIR="$HOME/Documents" XDG_MUSIC_DIR="$HOME/Music" XDG_PICTURES_DIR="$HOME/Pictures" XDG_VIDEOS_DIR="$HOME/Videos"

output from home

XDG_DESKTOP_DIR="$HOME/Masaüstü" XDG_DOWNLOAD_DIR="$HOME/İndirilenler" XDG_TEMPLATES_DIR="$HOME/Şablonlar" XDG_PUBLICSHARE_DIR="$HOME/Genel" XDG_DOCUMENTS_DIR="$HOME/Belgeler" XDG_MUSIC_DIR="$HOME/Müzik" XDG_PICTURES_DIR="$HOME/Resimler" XDG_VIDEOS_DIR="$HOME/Videolar"

can this be the reason? If so what would be the workaround?

Also my locales in snap shell not working, non english characters printed as "??" but i doubt that this is related to problem.