Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7736179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:40:53+00:00 2026-06-01T07:40:53+00:00

I’m currently building a simple application on Gjs , which should change the background-image

  • 0

I’m currently building a simple application on Gjs, which should change the background-image of my gnome-shell. A solution on how this can be done using the gsettings-tool can be found here.

Since I want to build a desktop-application around it, I want to change the org.gnome.desktop.background.picture-uri-key by using Gio’s GSettings-class. But using the set_X()-method does not change the value of the key.

This is my code to change the gsettings value:

var gio = imports.gi.Gio;

// Get the GSettings-object for the background-schema:
var background = new gio.Settings({schema: "org.gnome.desktop.background"});

// Read the current Background-Image:
print( "Current Background-Image: "+background.get_string("picture-uri") );

if (background.is_writable("picture-uri")){
    // Set a new Background-Image (should show up immediately):
    if (background.set_string("picture-uri", "file:///path/to/some/pic.jpg")){
        print("Success!");
    }
    else throw "Couldn't set the key!";
} else throw "The key is not writable";

Reading the value does work as expected, the is_writable()-method returns true and the set_string()-method also returns true.

I have checked that I’m not in “delay-apply” mode and the key has a GVariantType of string, so the set_string()-method should work.

Using the normal gsettings command-line tool (as explained in the linked post) works just fine.

I can’t figure out what the problem is, is there any place I can look for logs or something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:40:54+00:00Added an answer on June 1, 2026 at 7:40 am

    After not getting any responses here I asked the same question on the gjs-mailing list.

    It turned out that the writes to dconf were not yet on the disk when my script exited, so they were never really applied.

    The solution was to call the g_settings_sync() function (JsDoc) right after the set_string() function, to ensure that all writes had finished.

    if (background.set_string("picture-uri", "file:///path/to/some/pic.jpg")){
        gio.Settings.sync()
        print("Success!");
    }
    

    Thanks to Johan Dahlin and his answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.