Closed michallepicki closed 2 years ago
Running this from the terminal will work /var/home/michal/.local/bin/distrobox-enter -n ubu -- ' gedit %U'
. I belive your gtk-launch
command is trying to find gedit on the host machine and that's why the path assertion fails, it could not find an installation of gedit.
Hi @misobarisic , thanks for the info.
Running this from the terminal will work /var/home/michal/.local/bin/distrobox-enter -n ubu -- ' gedit %U'.
Yes, it works (opens a new file called %U
but more or less works).
I'm trying to debug why the application doesn't start from the menu, that's why I tried gtk-launch
, to get logs of what happens when I try to open the app from the host menu, to see why it gets stuck there. If there's a different way to mimic that I can try a different command.
Edit: When I try an app that doesn't exist on the host I get a different error:
$ gtk-launch nonexisting
gtk-launch: no such application nonexisting
So I think that having a desktop file in $HOME/.local/share/applications
and seeing a different log means that it can find it and tries to start it, but please correct me if I'm wrong.
There is also the possibility of using distrobox-export --bin ...
which allows you to export gedit
from inside the container to ~/.local/bin
on the outside making you able to just run gedit
on the host
@michallepicki I've created a PR that should fix this
I've tested with your commands setup and it's working now can you also verify?
(remember that you can put the new distrobox-export somewhere else and call it with a complete path to test)
@89luca89 I tested #300 and it looks good, it fixes the issue. Thank you!
Perfect!
Describe the bug When exporting the code application (e.g. gedit) from an ubuntu box, the app doesn't launch on the host.
To Reproduce Create a new ubuntu:latest (22.04) box, enter and install gedit
The application file gets exported:
but using the app doesn't launch it. The app starts correctly when started from within the box using
gedit
command.Expected behavior The application window opens after using the exported shortcut
Logs
Exporting the app shows:
Click to open
``` # in the container: $ distrobox-export --app gedit --verbose + [ ! -f /run/.containerenv ] + id -u + [ 1000 -eq 0 ] + [ -z gedit ] + [ -n gedit ] + [ -n ] + [ -n gedit ] + [ -n ] + [ -n ] + [ -n ] + uname -n + cut -d. -f1 + container_name=ubu + container_command_prefix=/var/home/michal/.local/bin/distrobox-enter -n ubu -- ' + [ -z ] + exported_app_label= (on ubu) + export_application + grep -ril Exec=.*gedit /usr/share/applications/org.gnome.gedit.desktop /usr/share/applications/python3.10.desktop /usr/share/applications/xdg-desktop-portal-gtk.desktop /usr/share/applications/yelp.desktop /var/lib/flatpak/exports/share/applications/mimeinfo.cache /var/lib/flatpak/exports/share/applications/org.fedoraproject.MediaWriter.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Calculator.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Calendar.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Characters.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Connections.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Contacts.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Evince-previewer.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Evince.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Extensions.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Logs.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Maps.desktop /var/lib/flatpak/exports/share/applications/org.gnome.TextEditor.desktop /var/lib/flatpak/exports/share/applications/org.gnome.Weather.desktop /var/lib/flatpak/exports/share/applications/org.gnome.baobab.desktop /var/lib/flatpak/exports/share/applications/org.gnome.clocks.desktop /var/lib/flatpak/exports/share/applications/org.gnome.eog.desktop /var/lib/flatpak/exports/share/applications/org.gnome.font-viewer.desktop /var/lib/flatpak/exports/share/applications/org.libreoffice.LibreOffice.base.desktop /var/lib/flatpak/exports/share/applications/org.libreoffice.LibreOffice.calc.desktop /var/lib/flatpak/exports/share/applications/org.libreoffice.LibreOffice.desktop /var/lib/flatpak/exports/share/applications/org.libreoffice.LibreOffice.draw.desktop /var/lib/flatpak/exports/share/applications/org.libreoffice.LibreOffice.impress.desktop /var/lib/flatpak/exports/share/applications/org.libreoffice.LibreOffice.math.desktop /var/lib/flatpak/exports/share/applications/org.libreoffice.LibreOffice.writer.desktop /var/lib/flatpak/exports/share/applications/org.libreoffice.LibreOffice.xsltfilter.desktop + desktop_files=/usr/share/applications/org.gnome.gedit.desktop + [ -z /usr/share/applications/org.gnome.gedit.desktop ] + icon_files= + grep Icon= /usr/share/applications/org.gnome.gedit.desktop + cut -d= -f2- + icon_name=org.gnome.gedit + [ -e org.gnome.gedit ] + find /usr/share/icons /usr/share/pixmaps /var/lib/flatpak/exports/share/icons -iname *org.gnome.gedit* + icon_files= /usr/share/icons/hicolor/scalable/apps/org.gnome.gedit.svg /usr/share/icons/hicolor/symbolic/apps/org.gnome.gedit-symbolic.svg + mkdir -p /run/host/var/home/michal/.local/share/applications + icon_file_absolute_path= + dirname /usr/share/icons/hicolor/scalable/apps/org.gnome.gedit.svg + sed s|/usr/share/|\/run\/host\//var/home/michal/.local/share/|g + sed s|/var/lib/flatpak/exports/share|\/run\/host\//var/home/michal/.local/share/|g + sed s|pixmaps|icons|g + icon_home_directory=/run/host//var/home/michal/.local/share/icons/hicolor/scalable/apps + dirname /usr/share/icons/hicolor/scalable/apps/org.gnome.gedit.svg + [ /run/host//var/home/michal/.local/share/icons/hicolor/scalable/apps = /usr/share/icons/hicolor/scalable/apps ] + [ 0 -ne 0 ] + mkdir -p /run/host//var/home/michal/.local/share/icons/hicolor/scalable/apps + cp -r /usr/share/icons/hicolor/scalable/apps/org.gnome.gedit.svg /run/host//var/home/michal/.local/share/icons/hicolor/scalable/apps + dirname /usr/share/icons/hicolor/symbolic/apps/org.gnome.gedit-symbolic.svg + sed s|/usr/share/|\/run\/host\//var/home/michal/.local/share/|g + sed s|/var/lib/flatpak/exports/share|\/run\/host\//var/home/michal/.local/share/|g + sed s|pixmaps|icons|g + icon_home_directory=/run/host//var/home/michal/.local/share/icons/hicolor/symbolic/apps + dirname /usr/share/icons/hicolor/symbolic/apps/org.gnome.gedit-symbolic.svg + [ /run/host//var/home/michal/.local/share/icons/hicolor/symbolic/apps = /usr/share/icons/hicolor/symbolic/apps ] + [ 0 -ne 0 ] + mkdir -p /run/host//var/home/michal/.local/share/icons/hicolor/symbolic/apps + cp -r /usr/share/icons/hicolor/symbolic/apps/org.gnome.gedit-symbolic.svg /run/host//var/home/michal/.local/share/icons/hicolor/symbolic/apps + basename /usr/share/applications/org.gnome.gedit.desktop + desktop_original_file=org.gnome.gedit.desktop + basename /usr/share/applications/org.gnome.gedit.desktop + desktop_home_file=ubu-org.gnome.gedit.desktop + [ 0 -ne 0 ] + sed s|^Exec=|Exec=/var/home/michal/.local/bin/distrobox-enter -n ubu -- ' |g /usr/share/applications/org.gnome.gedit.desktop + sed s|\(%.*\)| \1|g + sed s|^Exec=.*|&'|g + sed s|^TryExec=.*|TryExec=true|g + sed s|Name.*|& (on ubu)|g + grep -q StartupWMClass /run/host/var/home/michal/.local/share/applications/ubu-org.gnome.gedit.desktop + printf StartupWMClass=%s\n gedit + [ -n ] + sed -i s|/usr/share/|\/run\/host/var/home/michal/.local/share/|g /run/host/var/home/michal/.local/share/applications/ubu-org.gnome.gedit.desktop + sed -i s|pixmaps|icons|g /run/host/var/home/michal/.local/share/applications/ubu-org.gnome.gedit.desktop + [ 0 -ne 0 ] + printf Application %s successfully exported.\nOK!\n gedit Application gedit successfully exported. OK! + printf %s will appear in your applications list in a few seconds.\n gedit gedit will appear in your applications list in a few seconds. + [ 0 -ne 0 ] ```When I try to run it from terminal (I think that's the way to do it?) I see this log but nothing happens, the app doesn't open:
Desktop (please complete the following information):
Which version of distrobox? 1.3.1 from main (commit https://github.com/89luca89/distrobox/commit/f763894ca52a5f6cd2121e3c5bedd120b0ed3cb4 )
Additional information I'm on Fedora Silverblue. Maybe it's related to the fact that I'm creating the container in a different
--home
path?