LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 08-07-2005, 06:03 PM   #1
verbose
Member
 
Registered: Aug 2004
Distribution: deb lenny 2.6.21-amd64
Posts: 320

Rep: Reputation: 31
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
 
Old 08-07-2005, 06:17 PM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 65
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.
 
Old 08-07-2005, 06:36 PM   #3
demian
Member
 
Registered: Apr 2001
Location: Bremen, Germany
Distribution: Debian
Posts: 303

Rep: Reputation: 30
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.
 
Old 08-07-2005, 06:48 PM   #4
verbose
Member
 
Registered: Aug 2004
Distribution: deb lenny 2.6.21-amd64
Posts: 320

Original Poster
Rep: Reputation: 31
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.

Last edited by verbose; 08-07-2005 at 06:52 PM.
 
Old 08-07-2005, 06:59 PM   #5
demian
Member
 
Registered: Apr 2001
Location: Bremen, Germany
Distribution: Debian
Posts: 303

Rep: Reputation: 30
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

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

Last edited by demian; 08-07-2005 at 07:18 PM.
 
Old 08-08-2005, 12:28 AM   #6
verbose
Member
 
Registered: Aug 2004
Distribution: deb lenny 2.6.21-amd64
Posts: 320

Original Poster
Rep: Reputation: 31
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.

Last edited by verbose; 08-08-2005 at 12:40 AM.
 
Old 08-08-2005, 12:40 AM   #7
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 47
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
 
Old 08-08-2005, 12:43 AM   #8
verbose
Member
 
Registered: Aug 2004
Distribution: deb lenny 2.6.21-amd64
Posts: 320

Original Poster
Rep: Reputation: 31
How do you refresh the desktop? If I knew how to do that, I'd be set.
 
Old 08-08-2005, 01:13 AM   #9
kencaz
Senior Member
 
Registered: Mar 2005
Location: Las Vegas, NV
Distribution: Mandriva Slackware FreeBSD
Posts: 1,468

Rep: Reputation: 47
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
 
Old 08-08-2005, 01:59 AM   #10
verbose
Member
 
Registered: Aug 2004
Distribution: deb lenny 2.6.21-amd64
Posts: 320

Original Poster
Rep: Reputation: 31
I have resolved the conflict.
Thanks for everyone's help.
 
Old 07-19-2012, 10:31 AM   #11
warkior
LQ Newbie
 
Registered: Jul 2012
Posts: 1

Rep: Reputation: Disabled
Care to share?

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to change workspace by command line melinda_sayang Slackware 29 07-21-2011 03:51 AM
change the time from the command line juanb Linux - Newbie 3 10-31-2007 02:11 AM
Change workspace from command line 3saul Linux - Software 4 11-18-2005 06:02 PM
Can I change the console command line? coopns Linux - Newbie 3 06-16-2004 07:20 PM
How to change partitions that are mounted from command line? Perception Linux - Software 1 10-19-2003 05:51 AM


All times are GMT -5. The time now is 11:16 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration