89luca89 / distrobox

Use any linux distribution inside your terminal. Enable both backward and forward compatibility with software and freedom to use whatever distribution you’re more comfortable with. Mirror available at: https://gitlab.com/89luca89/distrobox
https://distrobox.it/
GNU General Public License v3.0
9.86k stars 404 forks source link

[Error] distrobox-export creates icon, but cannot be executed #597

Closed Microwave-WYB closed 1 year ago

Microwave-WYB commented 1 year ago

Describe the bug I exported tilix to my gnome desktop, but clicking the icon won't open the application. I'm using Clear Linux To Reproduce I installed tilix in my arch container, I exported with this command

distrobox-export tilix

I then clicked the icon in my application grid, nothing happened. I tried to manually execute the .desktop file:

gtk-launch arch-com.gexperts.Tilix

The application opened normally.

Expected behavior App should open when I click the icon.

Logs

+ '[' '!' -f /run/.containerenv ']'
+ grep -q rootless=0 /run/.containerenv
++ id -u
+ '[' 1000 -eq 0 ']'
+ '[' -z tilix ']'
+ '[' -n tilix ']'
+ '[' -n '' ']'
+ '[' -n tilix ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n arch ']'
+ container_name=arch
+ '[' -z arch ']'
+ container_command_prefix='/home/wyb/.local/bin/distrobox-enter  -n arch --  '
+ '[' -z '' ']'
+ exported_app_label=' (on arch)'
+ case "${export_action}" in
+ export_application
+ canon_dirs=
+ '[' -d /usr/share/applications ']'
+ canon_dirs=/usr/share/applications
+ '[' -d /usr/local/share/applications ']'
+ '[' -d /var/lib/flatpak/exports/share/applications ']'
+ '[' -d /home/wyb/.local/share/applications ']'
+ canon_dirs='/usr/share/applications /home/wyb/.local/share/applications'
++ find /usr/share/applications /home/wyb/.local/share/applications -type f -exec grep -qle 'Exec=.*tilix.*' '{}' ';' -exec grep -Le 'Exec=.*/home/wyb/.local/bin/distrobox-enter.*' '{}' ';'
++ find /usr/share/applications /home/wyb/.local/share/applications -name 'tilix*'
+ desktop_files=/usr/share/applications/com.gexperts.Tilix.desktop
+ '[' -z /usr/share/applications/com.gexperts.Tilix.desktop ']'
+ icon_files=
+ for desktop_file in ${desktop_files}
++ grep Icon= /usr/share/applications/com.gexperts.Tilix.desktop
++ cut -d= -f2-
+ icon_name=com.gexperts.Tilix
+ '[' -e com.gexperts.Tilix ']'
++ find /usr/share/icons /usr/share/pixmaps /var/lib/flatpak/exports/share/icons -iname '*com.gexperts.Tilix*'
++ :
+ icon_files=' /usr/share/icons/hicolor/scalable/apps/com.gexperts.Tilix.svg
/usr/share/icons/hicolor/symbolic/apps/com.gexperts.Tilix-symbolic.svg'
+ mkdir -p /run/host/home/wyb/.local/share/applications
+ icon_file_absolute_path=
+ for icon_file in ${icon_files}
++ dirname /usr/share/icons/hicolor/scalable/apps/com.gexperts.Tilix.svg
++ sed 's|/usr/share/|\/run\/host\//home/wyb/.local/share/|g'
++ sed 's|/var/lib/flatpak/exports/share|\/run\/host\//home/wyb/.local/share/|g'
++ sed 's|pixmaps|icons|g'
+ icon_home_directory=/run/host//home/wyb/.local/share/icons/hicolor/scalable/apps
++ dirname /usr/share/icons/hicolor/scalable/apps/com.gexperts.Tilix.svg
+ '[' /run/host//home/wyb/.local/share/icons/hicolor/scalable/apps = /usr/share/icons/hicolor/scalable/apps ']'
+ '[' 0 -ne 0 ']'
+ mkdir -p /run/host//home/wyb/.local/share/icons/hicolor/scalable/apps
++ realpath /usr/share/icons/hicolor/scalable/apps/com.gexperts.Tilix.svg
+ cp -r /usr/share/icons/hicolor/scalable/apps/com.gexperts.Tilix.svg /run/host//home/wyb/.local/share/icons/hicolor/scalable/apps
+ for icon_file in ${icon_files}
++ dirname /usr/share/icons/hicolor/symbolic/apps/com.gexperts.Tilix-symbolic.svg
++ sed 's|/usr/share/|\/run\/host\//home/wyb/.local/share/|g'
++ sed 's|/var/lib/flatpak/exports/share|\/run\/host\//home/wyb/.local/share/|g'
++ sed 's|pixmaps|icons|g'
+ icon_home_directory=/run/host//home/wyb/.local/share/icons/hicolor/symbolic/apps
++ dirname /usr/share/icons/hicolor/symbolic/apps/com.gexperts.Tilix-symbolic.svg
+ '[' /run/host//home/wyb/.local/share/icons/hicolor/symbolic/apps = /usr/share/icons/hicolor/symbolic/apps ']'
+ '[' 0 -ne 0 ']'
+ mkdir -p /run/host//home/wyb/.local/share/icons/hicolor/symbolic/apps
++ realpath /usr/share/icons/hicolor/symbolic/apps/com.gexperts.Tilix-symbolic.svg
+ cp -r /usr/share/icons/hicolor/symbolic/apps/com.gexperts.Tilix-symbolic.svg /run/host//home/wyb/.local/share/icons/hicolor/symbolic/apps
+ for desktop_file in ${desktop_files}
++ basename /usr/share/applications/com.gexperts.Tilix.desktop
+ desktop_original_file=com.gexperts.Tilix.desktop
++ basename /usr/share/applications/com.gexperts.Tilix.desktop
+ desktop_home_file=arch-com.gexperts.Tilix.desktop
+ '[' 0 -ne 0 ']'
+ sed 's|^Exec=|Exec=/home/wyb/.local/bin/distrobox-enter  -n arch --   |g' /usr/share/applications/com.gexperts.Tilix.desktop
+ sed 's|\(%.*\)| \1|g'
+ sed '/^TryExec=.*/d'
+ sed '/^DBusActivatable=true/d'
+ sed 's|Name.*|&  (on arch)|g'
+ grep -q StartupWMClass /run/host/home/wyb/.local/share/applications/arch-com.gexperts.Tilix.desktop
+ printf 'StartupWMClass=%s\n' tilix
+ '[' -n '' ']'
+ sed -i 's|Icon=/usr/share/|Icon=/run/host/home/wyb/.local/share/|g' /run/host/home/wyb/.local/share/applications/arch-com.gexperts.Tilix.desktop
+ sed -i 's|pixmaps|icons|g' /run/host/home/wyb/.local/share/applications/arch-com.gexperts.Tilix.desktop
+ '[' 0 -ne 0 ']'
+ printf 'Application %s successfully exported.\nOK!\n' tilix
Application tilix successfully exported.
OK!
+ printf '%s will appear in your applications list in a few seconds.\n' tilix
tilix will appear in your applications list in a few seconds.

Desktop (please complete the following information):

Additional context I'm using Clear Linux.

89luca89 commented 1 year ago

Hi @Microwave-WYB I've tried on 3 different host distros (Ubuntu, Fedora, Suse) and it works as intended

Can you give me some logs of when you click on the icon? Maybe a journalctl -f and you paste the part where you click on the tilix icon to launch it