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
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.
Try $USER which should be what you want, I think, though I am not sure exactly what you are asking.
Code-tags --- Boot-Repair --- Grub2 wiki & Grub2 Basics --- RootSudo --- Wireless-Info --- SolvedThreads --- System-Info-Script
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
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:
You can export this to be an environment variable with the command:Code:BACKGROUND=`gsettings get org.gnome.desktop.background picture-uri`
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
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.
Yes, and to change the desktop background you could supply the set argument to gsettings, as follows:
Presumably you could use get to find the background image, and use the path to set the Plymouth and grub splash.Code:gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/MyNewImage.jpg'
Maybe you would have to run it using cron. A simple structure might be:
- Check if the BACKGROUND variable is set. If not, set it.
- Periodically check if BACKGROUND == current org.gnome.desktop.background picture-uri
- 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