UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How to change background image programatically?

    Scheduled Pinned Locked Moved App Development
    background
    3 Posts 3 Posters 84 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      AdFundum
      last edited by

      Hello everyone,

      I am a noob, trying to become more familiar with making apps and i created a test project for myself in which i am trying to make an app that changes the background to a random image in a specific folder each hour of the day.

      This seemed like it should not be too difficult but I am running into some issues. I am currently messing around in an adb shell with gsettings and also trying dbus-send and gdbus with org.freedesktop.Accounts.User BackgroundFile but when i try to Set the value, it does not update since i don't have write ability. I am assuming this is due to sandboxing. Is there a recommended way of interacting with the system to change the background programatically?

      I tried looking through the documentation but I can't find anything that really describes any of this.

      brenno.almeidaB C 2 Replies Last reply Reply Quote 0
      • brenno.almeidaB Offline
        brenno.almeida @AdFundum
        last edited by

        @AdFundum did you find a command that works from the terminal/adb shell? If so, does that command work if you make your app unconfined?

        Its possible that UT does not have an app armor policy that fits your use case, and that's the cause of your problem. From the list of policy groups I cannot see anything that would allow a confined app to change the background image.

        https://docs.ubports.com/no/latest/appdev/platform/apparmor.html

        1 Reply Last reply Reply Quote 0
        • C Online
          ChromiumOS-Guy @AdFundum
          last edited by

          @AdFundum i dont know about confined use but i know how to do it, its not a single command and has a couple of steps. look at lss background module its basically the how to for it.

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post