<div dir="ltr"><div><div><div><div><div><div><div><div>Hi Didier, hi all.<br><br></div>I've been trying to accomplish this mission but I miss something (my bet is that I need an interface similar to gsettings but it doesn't exist something like this).<br><br></div>1.- I have successfully created a symlink from /home/$USER/.config/xfce4/xfconf/xfce-perchannel-xml inside the snap directory and all the XML files in which the configuration is stored are accessible for the application.<br><br></div>2.- I have defined, as stage package, xfconf, the tool to write configurations directly into those XML files.<br><br></div>3.- But when I execute ' xfconf-query --channel xfce4-desktop --property /backdrop/screen0/monitor0/<wbr>workspace0/last-image --set wallpaper.jpg' inside my application, I still receive 'Property "/backdrop/screen0/monitor0/<wbr>workspace0/last-image" does not exist on channel "xfce4-desktop". If a new property should be created, use the --create option.' and xfce-destop.xml (the XML which has the configuration for the background wallpaper) is not modified at all.<br><br></div>Maybe is needed an interface similar to gsettings? If this is the case, can I program something like that?<br><br></div>Thank you very much! :)<br><br></div>Best,<br><br></div>Eloy<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-10-24 11:08 GMT+02:00 Didier Roche <span dir="ltr"><<a href="mailto:didrocks@ubuntu.com" target="_blank">didrocks@ubuntu.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Le 24/10/2016 à 10:58, Eloy García (PC Actual) a écrit :<br>
> Hi Didier!<br>
><br>
> Thanks as always for your answer and feedback :) I suspected it and I<br>
> was taking a look to desktop launcher source code on github, but I<br>
> didn't have time to test it. One question: Can I create the symblink<br>
> when the snap application is executed (after installation) via the<br>
> script that i use to wrap up the launching process or will I have<br>
> problems to do that because of the confinement?<br>
<br>
</span>No worry :)<br>
<br>
As long as your snap has the right plug to access the initial file, this<br>
isn't an issue (and exactly what I'm doing in the desktop launcher for<br>
dconf/gsettings: creating symlink on first launch or after each snap<br>
upgrade if the symlink isn't present).<br>
You can see such an example in<br>
<a href="https://github.com/ubuntu/snapcraft-desktop-helpers/blob/master/glib-only/launcher-specific#L37" rel="noreferrer" target="_blank">https://github.com/ubuntu/<wbr>snapcraft-desktop-helpers/<wbr>blob/master/glib-only/<wbr>launcher-specific#L37</a><br>
for instance.<br>
<br>
(But yeah, it relies on /home/$USER/ and should probably find a better<br>
way to get user's real home directory. I can't use $HOME as it's<br>
redirected to SNAP_USER_DATA in some cases)<br>
<span class=""><br>
<br>
><br>
> Best,<br>
><br>
> Eloy<br>
><br>
> 2016-10-24 10:14 GMT+02:00 Didier Roche <<a href="mailto:didrocks@ubuntu.com">didrocks@ubuntu.com</a><br>
</span>> <mailto:<a href="mailto:didrocks@ubuntu.com">didrocks@ubuntu.com</a>>>:<br>
<span class="">><br>
> Le 06/10/2016 à 21:34, Eloy García (PC Actual) a écrit :<br>
>> Hi all.<br>
>><br>
>> I develop a java-based application to download and manage<br>
>> wallpapers from the Internet (wallpaperdownloader)<br>
</span>>> (<a href="https://bitbucket.org/eloy_garcia_pca/wallpaperdownloader/overview" rel="noreferrer" target="_blank">https://bitbucket.org/eloy_<wbr>garcia_pca/<wbr>wallpaperdownloader/overview</a> <<a href="https://bitbucket.org/eloy_garcia_pca/wallpaperdownloader/overview" rel="noreferrer" target="_blank">https://bitbucket.org/eloy_<wbr>garcia_pca/<wbr>wallpaperdownloader/overview</a>>)<wbr>.<br>
<div><div class="h5">>> The applications is in the store but now I'm trying to integrate<br>
>> XFCE desktop too. I mean, now you can set any wallpaper downloaded<br>
>> directly from the GUI and it is working fine for GNOME 3, Unity<br>
>> and MATE. All three of them use gsettings interface and<br>
>> desktop-gtk3 wrapper part as you can see in the snapcraft.yaml:<br>
>><br>
>> name: wallpaperdownloader<br>
>> version: "2.2"<br>
>> summary: Download and manage your favorite wallpapers from the Internet<br>
>> description: WallpaperDownloader is a simple GUI Java based application for<br>
>> downloading and managing wallpapers from the Internet<br>
>> grade: stable<br>
>> confinement: strict<br>
>><br>
>> apps:<br>
>> wallpaperdownloader:<br>
>> command: wallpaperdownloader.sh<br>
>> plugs: [x11, network-bind, home, gsettings]<br>
>><br>
>> parts:<br>
>> # Pulls the code from the original source (master branch)<br>
>> # desktop/gtk3 is a snapcraft part (snapcraft-desktop-helpers)<br>
>> from the Wiki: <a href="https://wiki.ubuntu.com/snapcraft/parts" rel="noreferrer" target="_blank">https://wiki.ubuntu.com/<wbr>snapcraft/parts</a><br>
>> <<a href="https://wiki.ubuntu.com/snapcraft/parts" rel="noreferrer" target="_blank">https://wiki.ubuntu.com/<wbr>snapcraft/parts</a>><br>
>> # It enables desktop integration and gsettings manipulation from<br>
>> the confined application<br>
>> # It is necessary to use gsettings interface (see above) in order<br>
>> to have a fully functional<br>
>> # desktop/gtk3 part<br>
>> # Github repository for snapcraft-desktop-helpers:<br>
>> <a href="https://github.com/ubuntu/snapcraft-desktop-helpers" rel="noreferrer" target="_blank">https://github.com/ubuntu/<wbr>snapcraft-desktop-helpers</a><br>
>> <<a href="https://github.com/ubuntu/snapcraft-desktop-helpers" rel="noreferrer" target="_blank">https://github.com/ubuntu/<wbr>snapcraft-desktop-helpers</a>><br>
>> wallpaperdownloader:<br>
>> plugin: maven<br>
>> source: ..<br>
>> stage-packages:<br>
>> # mate-desktop-common is necessary to have MATE gsettings schemas<br>
>> available for the application<br>
>> - mate-desktop-common<br>
>> after: [desktop/gtk3]<br>
>><br>
>> # It will copy wallpaperdownloader script into /bin/<br>
>> # This script contains all the commands needed (sets env<br>
>> variables, launches the jar file...) to<br>
>> # execute the application<br>
>> exec:<br>
>> plugin: dump<br>
>> source: scripts<br>
>> Now, if XFCE desktop is detected by the application, the command<br>
>> run inthe background is 'xfconf-query --channel xfce4-desktop<br>
>> --property /backdrop/screen0/monitor0/<wbr>workspace0/last-image --set<br>
>> wallpaper.jpg'. If the application runs natively, there is no<br>
>> problem and the wallpaper is set properly. But when I test the<br>
>> snap package built, this is the error thrown:<br>
>><br>
>> ERROR LinuxWallpaperChanger:188 - Property<br>
>> "/backdrop/screen0/monitor0/<wbr>workspace0/last-image" does not exist<br>
>> on channel "xfce4-desktop". If a new property should be created,<br>
>> use the --create option.<br>
>><br>
>> I have included xfconf as stage-package and the command<br>
>> xfconf-query is found within the snap. Could you give me a hint to<br>
>> solve this problem?<br>
>><br>
>> Thank you very much for your time and your help :)<br>
><br>
> Hey Eloy,<br>
><br>
> I'm not a xfconf user and so can't answer to you precisly. However,<br>
> my guess is that you will need a file (like the dconf one we are<br>
> using in GNOME/Unity environment) shared between your user's<br>
> settings and the snap writable path.<br>
> The desktop launcher is creating a symlink (accessed via the home<br>
> interface) between the main user's dconf/user file to path of the<br>
> snap writable path, to be able to read the value. The gsettings<br>
> interfaces give, on its side, access to the dbus call for this.<br>
><br>
> I wonder if the unaccessible file/dbus property could trigger this<br>
> error fallback in xfconf, and hence, prints that message.<br>
><br>
> I hope this helps!<br>
> Cheers,<br>
> Didier<br>
><br>
><br>
> --<br>
> Snapcraft mailing list<br>
</div></div>> <a href="mailto:Snapcraft@lists.snapcraft.io">Snapcraft@lists.snapcraft.io</a> <mailto:<a href="mailto:Snapcraft@lists.snapcraft.io">Snapcraft@lists.<wbr>snapcraft.io</a>><br>
<div class="HOEnZb"><div class="h5">> Modify settings or unsubscribe at:<br>
> <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/snapcraft</a><br>
> <<a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/snapcraft</a>><br>
><br>
><br>
><br>
><br>
> --<br>
> Eloy García Almadén<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Eloy García Almadén<br></div></div>
</div>