Access to other commands
Eloy García (PC Actual)
eloy.garcia.pca at gmail.com
Thu Sep 8 07:17:07 UTC 2016
Hi all.
I currently have several problems with my snap package for
wallpaperdownloader application, a java-based piece of software that
downloads wallpapers from the Internet, and maybe this is the solution for
some of them.
In this application, I execute some Linux command tools such as xdg-open
and gsettings. They work flawlessly within a "native" environment, but when
I try to execute them inside the snap package, they simply don't work.
Gustavo, when you suggest to use the line: bus-send --print-reply --session
--dest=com.canonical.SafeLauncher / com.canonical.SafeLauncher.OpenURL
string:"$1"
could you give an example of that? I mean, if I want to, for example, open
a browser using "xdg-open https://www.google.com" executing this command
from my Java code, what would be the line I should use instead?. This
implies to modify my java code too and I had to do the distinction between
the application executed in a native environment and in a snap confinement.
This wouldn't be the desired way of packaging the app. Would be possible to
use some kind of interface to have access to the "native" command line
tools installed in the system? This way, source code would be agnostic (I
mean, I didn't have to tweak the application depending on the environment
executed) and it would be only a matter of snapcraft.yaml configuration.
Thanks in advance :)
Best,
Eloy
2016-09-08 4:11 GMT+02:00 Gustavo Niemeyer <gustavo.niemeyer at canonical.com>:
>
>
> On Wed, Sep 7, 2016 at 10:31 PM, Mark Shuttleworth <mark at ubuntu.com>
> wrote:
>
>> On 07/09/16 12:32, Matthew Williams wrote:
>> > I have a few applications I'm looking to snap, but quite a lot of them
>> > shell out to other commands at some point and it's not always
>> > practical to include these with my snap, one concrete example is
>> > shelling out to /usr/bin/sensible-browser.
>>
>
> We have something slightly better than this. Any snap can call xdg-open
> $url and have that URL being sent to a safe launcher over dbus.
>
> This is the exact line:
>
> bus-send --print-reply --session --dest=com.canonical.SafeLauncher /
> com.canonical.SafeLauncher.OpenURL string:"$1"
>
> Because this is always safe to do and offered over a common mechanism, we
> don't need an interface to mediate it. If something is listening, a browser
> is fired.
>
> We need to make sensible-browser call the same so applications just work.
>
>
> gustavo @ http://niemeyer.net
>
> --
> Snapcraft mailing list
> Snapcraft at lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/snapcraft
>
>
--
Eloy García Almadén
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20160908/da7709d9/attachment.html>
More information about the Snapcraft
mailing list