Results 1 to 7 of 7

Thread: Desktop's background system variable?

  1. #1
    Join Date
    Dec 2011
    Beans
    51

    Desktop's background system variable?

    Hello,
    Is there system variable for desktop's background path?

    such like : ~ = $HOME = /home/username etc.

    Thanks ..

    p.s. quick reply editor doesn't focusing when clicking
    Last edited by CProgramming; March 15th, 2012 at 09:51 AM.

  2. #2
    Join Date
    Jul 2005
    Location
    I think I'm here! Maybe?
    Beans
    Hidden!
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: Desktop's background system variable?

    Try $USER which should be what you want, I think, though I am not sure exactly what you are asking.

  3. #3
    Join Date
    Mar 2010
    Location
    Dublin, Ireland
    Beans
    Hidden!
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Desktop's background system variable?

    Hi,

    No - as far as I'm aware, there's environment variable relating to the desktop wallpaper.

    The desktop wallpaper settings are stored at the org.gnome.desktop.background key in the dconf database.
    Matt
    blog.mattrudge.net for extra helpings of geeky Ubuntu goodness
    Get the Ubuntu Weekly Newsletter

  4. #4
    Join Date
    Dec 2011
    Beans
    51

    Re: Desktop's background system variable?

    Quote Originally Posted by lechien73 View Post
    Hi,

    No - as far as I'm aware, there's environment variable relating to the desktop wallpaper.

    The desktop wallpaper settings are stored at the org.gnome.desktop.background key in the dconf database.
    hey,

    how do I print the variable in the terminal?

  5. #5
    Join Date
    Mar 2010
    Location
    Dublin, Ireland
    Beans
    Hidden!
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Desktop's background system variable?

    Sorry for the delayed response - my laptop had an unfortunate lesson in the power of gravity!

    Anyway, to set a shell variable with the path of the background, you can use:

    Code:
    BACKGROUND=`gsettings get org.gnome.desktop.background picture-uri`
    You can export this to be an environment variable with the command:

    Code:
    export BACKGROUND
    Last edited by lechien73; March 18th, 2012 at 12:09 PM. Reason: Forgot a whole load :)
    Matt
    blog.mattrudge.net for extra helpings of geeky Ubuntu goodness
    Get the Ubuntu Weekly Newsletter

  6. #6
    Join Date
    Nov 2008
    Location
    Atlanta, GA
    Beans
    43
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Desktop's background system variable?

    So could this be used to keep backgrounds for Plymouth and grub updated with the desktop background?

    I've been looking for a way to change the desktop background, and have Plymouth and grub automatically change too.

  7. #7
    Join Date
    Mar 2010
    Location
    Dublin, Ireland
    Beans
    Hidden!
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Desktop's background system variable?

    Yes, and to change the desktop background you could supply the set argument to gsettings, as follows:

    Code:
    gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/MyNewImage.jpg'
    Presumably you could use get to find the background image, and use the path to set the Plymouth and grub splash.

    Maybe you would have to run it using cron. A simple structure might be:

    1. Check if the BACKGROUND variable is set. If not, set it.
    2. Periodically check if BACKGROUND == current org.gnome.desktop.background picture-uri
    3. If not, update Plymouth and grub splash (note - you will probably need to add this script to /etc/sudoers using visudo so that it can run without requiring a sudo password.
    Last edited by lechien73; March 20th, 2012 at 12:22 PM.
    Matt
    blog.mattrudge.net for extra helpings of geeky Ubuntu goodness
    Get the Ubuntu Weekly Newsletter

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •