Re: No such file or directory when try to execute gsettings

2016-09-18 Thread PC Actual
Hi Sebastien, hi all :)

Sorry for not answering before, but I don't have too much spare time and I
spent the whole last week trying different things with my snap package.
Sebastien, you pointed to me in the right direction, THANK YOU VERY MUCH! :)

I have tryied snapcraft-desktop-helpers with gsettings interface and they
did the trick! (with some problems that I think I'll described in another
thread in order to not mess this one which i think is solved).

So again, thank you very much for the help :)

Best,

Eloy

2016-09-08 15:38 GMT+02:00 Sebastien Bacher :

> Le 07/09/2016 à 12:04, Eloy García (PC Actual) a écrit :
> >
> >
> > I get your point and I think this is the real problem. I guess
> > gsettings command line tool from the snap is storing the correct
> > key/value inside the snap, but the "native" dconf database is not
> > getting the new value, because the change wasn't made using "native"
> > gsettings command line tool.
> No, it's the other way around. Writting to dconf goes through a proxy
> service and the client talks to the server using dbus, so with the
> gsettings interface your snap can contact the desktop service and the
> write is done in the real-session's dconf database.
>
> Reading is done by opening a file in the user directory though and that
> doesn't work "out of the box" from inside the snaps because your code is
> going to see the private-snap-dir and not the real system one.
> If you use the desktop common part it has a hack for that though
> https://github.com/ubuntu/snapcraft-desktop-helpers/
> blob/master/gtk/launcher-specific#L79
>
> > I have tried to search dconf database within snap confinement, but I
> > couldn't find it. Where should I search for it to see if the new value
> > for the wallpaper was set there?
> You should rather look on your desktop using e.g dconf-editor
>
>
> Cheers,
> Sebastien Bacher
>
>


-- 
Eloy García Almadén
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: No such file or directory when try to execute gsettings

2016-09-08 Thread Sebastien Bacher
Le 07/09/2016 à 12:04, Eloy García (PC Actual) a écrit :
>
>
> I get your point and I think this is the real problem. I guess
> gsettings command line tool from the snap is storing the correct
> key/value inside the snap, but the "native" dconf database is not
> getting the new value, because the change wasn't made using "native"
> gsettings command line tool.
No, it's the other way around. Writting to dconf goes through a proxy
service and the client talks to the server using dbus, so with the
gsettings interface your snap can contact the desktop service and the
write is done in the real-session's dconf database.

Reading is done by opening a file in the user directory though and that
doesn't work "out of the box" from inside the snaps because your code is
going to see the private-snap-dir and not the real system one.
If you use the desktop common part it has a hack for that though
https://github.com/ubuntu/snapcraft-desktop-helpers/blob/master/gtk/launcher-specific#L79

> I have tried to search dconf database within snap confinement, but I
> couldn't find it. Where should I search for it to see if the new value
> for the wallpaper was set there?
You should rather look on your desktop using e.g dconf-editor


Cheers,
Sebastien Bacher


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: No such file or directory when try to execute gsettings

2016-09-07 Thread PC Actual
Hi Sebastien!

First of all, thank you very much for your suggestions :)

I get your point and I think this is the real problem. I guess gsettings
command line tool from the snap is storing the correct key/value inside the
snap, but the "native" dconf database is not getting the new value, because
the change wasn't made using "native" gsettings command line tool. I have
tried to search dconf database within snap confinement, but I couldn't find
it. Where should I search for it to see if the new value for the wallpaper
was set there?

P.S.: I've been searching within the tree which is in
/snap/wallpaperdownloader/current with no luck.

Thank you very much again :D

2016-09-06 11:42 GMT+02:00 Sebastien Bacher :

> Le 30/08/2016 à 10:15, Eloy García (PC Actual) a écrit :
> > Thanks for your answer, but I forgot to say I tried gsettings and
> > unity7 interfaces with no success. Nevertheless, I only put those
> > interfaces in snapcraft.yml, but I didn't do anyting else
> > (configurations, tweaks...). Adding more information, this is the
> > script executed when wallpaperdownloader is launched. Maybe it is here
> > where I should add some mappings to the "native" environment?
>
>
> Hey again,
>
> Did you figure it out? The gsettings command talk over dbus to the
> service which is in the user session, so the key should be written in
> your user db, the confined code in the snap doesn't get back the value
> since dconf does that by mapping a file from the user directory so it
> might mean your frontend might not get the new value of the key. Can you
> check from the outside the value of the key?
>
> If you use the shared desktop launcher it includes an hack to symlink
> the snap dconf db to the real one which should make reading work as well
>
> Cheers,
>
> Sebastien Bacher
>
>


-- 
Eloy García Almadén
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: No such file or directory when try to execute gsettings

2016-09-06 Thread Sebastien Bacher
Le 30/08/2016 à 10:15, Eloy García (PC Actual) a écrit :
> Thanks for your answer, but I forgot to say I tried gsettings and
> unity7 interfaces with no success. Nevertheless, I only put those
> interfaces in snapcraft.yml, but I didn't do anyting else
> (configurations, tweaks...). Adding more information, this is the
> script executed when wallpaperdownloader is launched. Maybe it is here
> where I should add some mappings to the "native" environment?


Hey again,

Did you figure it out? The gsettings command talk over dbus to the
service which is in the user session, so the key should be written in
your user db, the confined code in the snap doesn't get back the value
since dconf does that by mapping a file from the user directory so it
might mean your frontend might not get the new value of the key. Can you
check from the outside the value of the key?

If you use the shared desktop launcher it includes an hack to symlink
the snap dconf db to the real one which should make reading work as well

Cheers,

Sebastien Bacher


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: No such file or directory when try to execute gsettings

2016-08-30 Thread PC Actual
Hi Sebastien!

Thanks for your answer, but I forgot to say I tried gsettings and unity7
interfaces with no success. Nevertheless, I only put those interfaces in
snapcraft.yml, but I didn't do anyting else (configurations, tweaks...).
Adding more information, this is the script executed when
wallpaperdownloader is launched. Maybe it is here where I should add some
mappings to the "native" environment?

#!/bin/sh
# Only for packaging!
# Script for snap packaging wallpaperdownloader application. It is not
related to the code itself
# Not good, needed for fontconfig
export XDG_DATA_HOME=$SNAP/usr/share
# Font Config
export FONTCONFIG_PATH=$SNAP/etc/fonts/config.d
export FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf
export HOME=$SNAP_USER_DATA
java -jar -Duser.home=$SNAP_USER_DATA $SNAP/jar/wallpaperdownloader.jar

Thanks again :)

Eloy

2016-08-30 10:05 GMT+02:00 Sebastien Bacher :

> Le 30/08/2016 à 09:20, Eloy García (PC Actual) a écrit :
> > Any ideas or suggestions? Thank you very much for your time and effort :)
>
>
> Hey,
>
> I didn't look into details of your snap but gsettings is confined so you
> need to add "gsettings" interface to your list, maybe start trying if
> that's enough to make it work
>
> Cheers,
>
> Sebastien Bacher
>
>


-- 
Eloy García Almadén
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: No such file or directory when try to execute gsettings

2016-08-30 Thread Sebastien Bacher
Le 30/08/2016 à 09:20, Eloy García (PC Actual) a écrit :
> Any ideas or suggestions? Thank you very much for your time and effort :)


Hey,

I didn't look into details of your snap but gsettings is confined so you
need to add "gsettings" interface to your list, maybe start trying if
that's enough to make it work

Cheers,

Sebastien Bacher


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: No such file or directory when try to execute gsettings

2016-08-30 Thread PC Actual
Hi all again.

As Sebastian Bacher suggested, I included gsettings binary within my snap
package. This is the snapcraft.yaml file:

name: wallpaperdownloader
version: "2.2"
summary: Download and manage your favorite wallpapers from the Internet
description: WallpaperDownloader is a simple GUI Java based application for
downloading and managing wallpapers from the Internet
confinement: strict

apps:
  wallpaperdownloader:
command: wallpaperdownloader.sh
plugs: [x11, network-bind, home]

parts:
  # Pulls the code from the original source (master branch)
  wallpaperdownloader:
plugin: maven
source: .
stage-packages:
  - libglib2.0-bin

  # It will copy wallpaperdownloader script into /bin/
  # This script contains all the commands needed (sets env variables,
launches the jar file...) to
  # execute the application
  exec:
plugin: copy
files:
  wallpaperdownloader.sh: bin/wallpaperdownloader.sh


-

Including libglib2.0-bin as stage-package, the application doesn't complain
anymore about "No such file or directoy" because it finds gsettings binary
on stage/usr/bin. Nevertheless, nothing happens when command line
"gsettings set org.gnome.desktop.background picture-uri
file://blablabla.jpg" is executed within the java code. I don't know how to
"link" this command inside the snap with the native "command" and
configuration files outside. The execution of this command should affect to
the native environment and not the snap confinement created I guess, in
order to change the current wallpaper in GNOME 3 or Unity.

Any ideas or suggestions? Thank you very much for your time and effort :)

Best,
Eloy




2016-08-26 11:00 GMT+02:00 Eloy García (PC Actual) <
eloy.garcia@gmail.com>:

> Thank you very much for your quick answer. I want to implement this for
> other desktop environments, so I guess I have to include every binary I
> want to invoke, right?
>
> I'll give it a try. Thanks again!
>
> El 26 ago. 2016 10:26 a. m., "Sebastien Bacher" 
> escribió:
>
>> Le 26/08/2016 à 07:23, Eloy García (PC Actual) a écrit :
>> > I have tried gsettings and Unity7 interfaces with no luck. i guess is
>> > more a question of executing a program outside the confinment. How
>> > could I do that? Thank you very much!
>>
>> Hey,
>>
>> Using the system command is not allowed but you can include it in your
>> snap and it should work (either copy the binary or stage-packages the deb)
>>
>> Cheers,
>>
>> Sebastien Bacher
>>
>>
>> --
>> Snapcraft mailing list
>> Snapcraft@lists.snapcraft.io
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailm
>> an/listinfo/snapcraft
>>
>


-- 
Eloy García Almadén
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: No such file or directory when try to execute gsettings

2016-08-26 Thread PC Actual
Thank you very much for your quick answer. I want to implement this for
other desktop environments, so I guess I have to include every binary I
want to invoke, right?

I'll give it a try. Thanks again!

El 26 ago. 2016 10:26 a. m., "Sebastien Bacher" 
escribió:

> Le 26/08/2016 à 07:23, Eloy García (PC Actual) a écrit :
> > I have tried gsettings and Unity7 interfaces with no luck. i guess is
> > more a question of executing a program outside the confinment. How
> > could I do that? Thank you very much!
>
> Hey,
>
> Using the system command is not allowed but you can include it in your
> snap and it should work (either copy the binary or stage-packages the deb)
>
> Cheers,
>
> Sebastien Bacher
>
>
> --
> Snapcraft mailing list
> Snapcraft@lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/snapcraft
>
-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft


Re: No such file or directory when try to execute gsettings

2016-08-26 Thread Sebastien Bacher
Le 26/08/2016 à 07:23, Eloy García (PC Actual) a écrit :
> I have tried gsettings and Unity7 interfaces with no luck. i guess is
> more a question of executing a program outside the confinment. How
> could I do that? Thank you very much!

Hey,

Using the system command is not allowed but you can include it in your
snap and it should work (either copy the binary or stage-packages the deb)

Cheers,

Sebastien Bacher


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft