LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   change background via command line (https://www.linuxquestions.org/questions/linux-general-1/change-background-via-command-line-350936/)

verbose 08-07-2005 06:03 PM

change background via command line
 
Does anyone know if there's a command which will change the background image? I ask because I'm fetching an image from a webpage and would then like to apply it as my wallpaper.

gdm


Thanks

rjlee 08-07-2005 06:17 PM

wmsetbg works with XPM, PNG, jpeg, Tiff and PPM graphics. You will need to set this command in your login script if it is to work every time you log out and back in.

If you want a single command that will set your background permanently, then this depends on your window manager and/or desktop environment.

demian 08-07-2005 06:36 PM

display -window root pic.jpg

(works with every image format that image magick supports). For KDE and gnome this might not work. KDE:

dcop kdesktop KBackgroundIface setWallpaper /path/to/pic.jpg N

N can be any number from 1-6 resulting in centered, tiled, center tiled, scaled centered (keep aspect), scaled tiled (keep aspect), scaled and centered (auto fit)

Don't know about gnome.

verbose 08-07-2005 06:48 PM

display -window root pic.jpg doesn't work for Gnome, but I appreciate your suggestion.

I'm looking at the display manpage.

*The command you've mentioned applies an image to a window, which isn't what I want. I want to make the image my desktop background.

demian 08-07-2005 06:59 PM

Quote:

Originally posted by verbose
display -window root pic.jpg doesn't work for Gnome
That's what I thought. Isn't there an option in nautilus you can use to not have it manage the background image? Else there should be a command line interfdace similar to the kde one from above. I think gconftool or something it's called

edit:

Quote:

*The command you've mentioned applies an image to a window, which isn't what I want. I want to make the image my desktop background.
Yeah, it applies it to the _root_ window. Which is what you want. The problem here is that nautilus draws over that.

anyways, found it through google :p

gconftool-2 --type string --set /desktop/gnome/background/picture_filename /path/to/image.jpg

verbose 08-08-2005 12:28 AM

Hmm, unfortunately this command doesn't seem to be working either.

*gconftool-2 --get filedir returns different values depending on the image I select using the command you've given me, but it is apparently not actually making the image the background.

Nevermind, it works just fine. I wasn't using /desktop/gnome/background/picture_filename but was instead specifying my own path.

Thank you very much.

kencaz 08-08-2005 12:40 AM

Well, probably the easiest way may be to have whatever program your using to fetch the background image to rename it to the current background image name... You will have to refresh your DT though...

KC

verbose 08-08-2005 12:43 AM

How do you refresh the desktop? If I knew how to do that, I'd be set.

kencaz 08-08-2005 01:13 AM

Well, I use KDE and if I right click on the DT I can refresh... Not sure what the command line argument would be for it... Someone must know, however....

KC

verbose 08-08-2005 01:59 AM

I have resolved the conflict.
Thanks for everyone's help.

warkior 07-19-2012 10:31 AM

Care to share?
 
Could you share the results of your search so that others could benefit?


All times are GMT -5. The time now is 06:33 PM.