{"action":"created","issue":{"url":"https://api.github.com/repos/ubuntu/snapcraft-desktop-helpers/issues/8","repository_url":"https://api.github.com/repos/ubuntu/snapcraft-desktop-helpers","labels_url":"https://api.github.com/repos/ubuntu/snapcraft-desktop-helpers/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/ubuntu/snapcraft-desktop-helpers/issues/8/comments","events_url":"https://api.github.com/repos/ubuntu/snapcraft-desktop-helpers/issues/8/events","html_url":"https://github.com/ubuntu/snapcraft-desktop-helpers/issues/8","id":177174057,"number":8,"title":"desktop-launch integration with a script","user":{"login":"egara","id":13696843,"avatar_url":"https://avatars.githubusercontent.com/u/13696843?v=3","gravatar_id":"","url":"https://api.github.com/users/egara","html_url":"https://github.com/egara","followers_url":"https://api.github.com/users/egara/followers","following_url":"https://api.github.com/users/egara/following{/other_user}","gists_url":"https://api.github.com/users/egara/gists{/gist_id}","starred_url":"https://api.github.com/users/egara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egara/subscriptions","organizations_url":"https://api.github.com/users/egara/orgs","repos_url":"https://api.github.com/users/egara/repos","events_url":"https://api.github.com/users/egara/events{/privacy}","received_events_url":"https://api.github.com/users/egara/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-15T13:19:40Z","updated_at":"2016-09-18T19:39:49Z","closed_at":"2016-09-18T19:39:49Z","body":"Hi\r\n\r\nI'm snapping an application called [wallpaperdownloader](https://github.com/ubuntu/snappy-playpen/tree/master/wallpaperdownloader) which downloads wallpapers fromt the Internet. So far so good. But now I'm developing version 2.2 with a new feature: A button to set the wallpaper selected for the Desktop. Natively, the java application is working fine for Unity and GNOME3, but my problem is that I cannot make it work inside a snap package. I've been digging around and I wrote an e-mail to snapcraft mailing list and a user pointed to my to this direction. I need to use gsettings command line tool from my snapped application and I don't know how to do it.\r\n\r\nI have tried to use snapcraft-desktop-helpers part but I suspect I don't use it in a proper way. This is my snapcraft.yaml file (please, be aware that I need to execute a script called wallpaperdownloader.sh as command in order to export some environment variables)\r\n\r\n```\r\nname: wallpaperdownloader\r\nversion: \"2.2\"\r\nsummary: Download and manage your favorite wallpapers from the Internet\r\ndescription: WallpaperDownloader is a simple GUI Java based application for downloading and managing wallpapers from the Internet\r\nconfinement: strict\r\n\r\napps:\r\n  wallpaperdownloader:\r\n    command: desktop-launch wallpaperdownloader.sh\r\n    plugs: [x11, network-bind, home, gsettings]\r\n\r\nparts:\r\n  # Pulls the code from the original source (master branch)\r\n  wallpaperdownloader:\r\n    plugin: maven\r\n    source: .\r\n    after: [desktop/gtk3]\r\n\r\n  # It will copy wallpaperdownloader script into /bin/\r\n  # This script contains all the commands needed (sets env variables, launches the jar file...) to\r\n  # execute the application\r\n  exec:\r\n    plugin: copy\r\n    files:\r\n      wallpaperdownloader.sh: bin/wallpaperdownloader.sh\r\n\r\n```\r\n\r\nWhen I install the snap package generated, first, the desktop launcher  doesn't have the icon defined in /setup/gui. Second, the launcher doesn't do anything apparently.\r\n\r\nThis is the script wallpaperdownloader.sh\r\n\r\n```\r\n#!/bin/sh\r\n# Only for packaging!\r\n# Script for snap packaging wallpaperdownloader application. It is not related to the code itself\r\n# Not good, needed for fontconfig\r\nexport XDG_DATA_HOME=$SNAP/usr/share\r\n# Font Config\r\nexport FONTCONFIG_PATH=$SNAP/etc/fonts/config.d\r\nexport FONTCONFIG_FILE=$SNAP/etc/fonts/fonts.conf\r\nexport HOME=$SNAP_USER_DATA\r\njava -jar -Duser.home=$SNAP_USER_DATA $SNAP/jar/wallpaperdownloader.jar\r\n```\r\n\r\nWhat is the problem? Using desktop-launch can I read and write values with gsettings? Thank you very much for your time :)\r\n\r\nBest,\r\n\r\nEloy"},"comment":{"url":"https://api.github.com/repos/ubuntu/snapcraft-desktop-helpers/issues/comments/247869103","html_url":"https://github.com/ubuntu/snapcraft-desktop-helpers/issues/8#issuecomment-247869103","issue_url":"https://api.github.com/repos/ubuntu/snapcraft-desktop-helpers/issues/8","id":247869103,"user":{"login":"egara","id":13696843,"avatar_url":"https://avatars.githubusercontent.com/u/13696843?v=3","gravatar_id":"","url":"https://api.github.com/users/egara","html_url":"https://github.com/egara","followers_url":"https://api.github.com/users/egara/followers","following_url":"https://api.github.com/users/egara/following{/other_user}","gists_url":"https://api.github.com/users/egara/gists{/gist_id}","starred_url":"https://api.github.com/users/egara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/egara/subscriptions","organizations_url":"https://api.github.com/users/egara/orgs","repos_url":"https://api.github.com/users/egara/repos","events_url":"https://api.github.com/users/egara/events{/privacy}","received_events_url":"https://api.github.com/users/egara/received_events","type":"User","site_admin":false},"created_at":"2016-09-18T19:39:49Z","updated_at":"2016-09-18T19:39:49Z","body":"Hi again.\r\n\r\nFinally I solved the problem. I put desktop-launch inside wallpaperdownloader.sh and now the final execution command is **desktop-launch java -jar -Duser.home=$SNAP_USER_DATA $SNAP/jar/wallpaperdownloader.jar** and it seems to work fine.\r\n\r\nThanks.\r\n\r\nBest,\r\n\r\nEloy"}}
{"actor":{"display_login":"egara"}}