Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
02-19-2005, 07:47 AM
|
#1
|
|
Member
Registered: Feb 2005
Posts: 71
Rep:
|
Saving A Set Wallpaper.....
Hi,
Os: Slackware 10
Window Manager: Fluxbox
Problem:
Been trying to work out for the past two days how to set backgrounds in fluxbox. Then i realised it was so simple lol. I have managed to set a background that i want but the problem occurs when i logout of X or reboot. I startx, enter fluxbox and the background is reset to the standard gray that comes with the theme i am running (Cthulhain). Anyone have any idea how i can make it store the background i have set?...
Thanks,
Colonel-1990.
|
|
|
|
02-19-2005, 05:27 PM
|
#2
|
|
Member
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827
Rep:
|
I myself got bored of that, so I made this script to get around better.. Hope you can catch some ideas from it.. (;
Code:
#!/bin/bash
# the point of this is to periodicly change the wallpaper symlink destination and run the new bg visible.
# we wont do a thing unless fluxbox is actually running
tsek=`ps aux | grep fl[u]xbox | cut -d " " -f 1 | tail -n 1`
if [ -z $tsek ]; then
exit 0
fi
# lets set some variables
juuseri=fyranthalas
DISPLAY=:0
symlink=/share/images/wallpapers/fluxbox.img # every theme has this set as the bg
dir=/share/images/wallpapers/fb.random/
#bgsetter=/usr/bin/wmsetbg # not working with crons
bgsetter="/usr/X11R6/bin/fbsetbg -f" # doesnt work with crons either ):
# go to the right user to accomplish the bg set
if [ "$USER" != "$juuseri" ]; then
su $juuseri
fi
# random code stolen from fbsetbg, thanks.. (;
number_of_wallpapers=`ls $dir|wc -l`
# some shells don't support $RANDOM
if [ -z $RANDOM ]; then
randomnumber=`(echo $$ ;time ps; w ; date )2>&1 | cksum | cut -f1 -d' '`
else
randomnumber=$RANDOM
fi
wallpapernumber=`expr $randomnumber % $number_of_wallpapers + 1`
wallpaper="$dir/`ls $dir|sed -n ${wallpapernumber}p`"
# stolen code ends
# and now we attempt to make the symlink
rm /share/images/wallpapers/fluxbox.img
ln -s $wallpaper /share/images/wallpapers/fluxbox.img
# and finaly, we set the bg
$bgsetter /share/images/wallpapers/fluxbox.img
Made this for the fun of it, but you get an idea hopefully how this can be used.. (:
|
|
|
|
02-19-2005, 06:19 PM
|
#3
|
|
Member
Registered: Feb 2005
Posts: 71
Original Poster
Rep:
|
Dont quite understand where to put this script/what it does. Are you saying there is no way of saving the desktop image?. Seems a bit stupid doesnt it ?
Colonel-1990.
|
|
|
|
02-19-2005, 06:32 PM
|
#4
|
|
Member
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827
Rep:
|
it is.. The main problem is, that in a way, fluxbox doesnt have a wallpaper system. fbsetbg and similar programs just "draw" it into the root window.. So, obviously when the root window closes, the render placed upon it also goes away.. One of the easiest ways is to do this:
1. cd to your wallpapers directory (the place you keep your wallpapers) and issue:
Code:
rm fluxbox.img && ln -s wallpaper_you_want.jpg fluxbox.img
2. Save the following code into a file, name it for eg. prepare.sh
Code:
#!/bin/bash
file=$1
grep -iv rootCommand $file > $file.clean
worked=`grep rootCommand $file.clean`
echo -n $file has been altered
if [ -z $worked ]; then
echo "rootCommand: bsetbg -f /path/to/fluxbox.img" >> $file.clean
echo " succesfully"
else echo " unsuccesfully"
fi
grep rootCommand $file.clean
then issue:
Code:
chmod a+x prepare.sh
Now, we can use this upon your themes, effectively replacing the line that sets the bg with the line pointing to the symlink. Heres how:
Code:
./prepare.sh ~/.fluxbox/styles/The_style_you_wana_use
3. Thats that, now you oughta get the wallpaper you have symlinked every time you start, and if you want to change the image, just redo #1 (:
Last edited by Artanicus; 02-19-2005 at 06:34 PM.
|
|
|
|
02-19-2005, 07:25 PM
|
#5
|
|
Member
Registered: Feb 2005
Posts: 71
Original Poster
Rep:
|
i cant seem to locate fluxbox.img :S does this file vary from person to person?
Colonel-1990.
|
|
|
|
02-20-2005, 02:18 AM
|
#6
|
|
Member
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827
Rep:
|
it shouldnt exist, we create it here.. The rm stage is just to make sure theres nothing in the way..
|
|
|
|
02-21-2005, 12:05 PM
|
#7
|
|
Member
Registered: Feb 2005
Posts: 71
Original Poster
Rep:
|
Found this out ages ago, but didnt post owt. If people are finding it hard to save a set wallpaper, its simple. What i did is i went into the theme directory e.g. /usr/X11R6/share/fluxbox/styles/theme and down towards the bottom on some themes there is a part that says ' rootCommand: fbsetbg -f ~/.fluxbox/wallpaper.png ' **please note ** you can change the ' fbsetbg ' part to whatever you use. change the part that says ' ~/.fluxbox/wallpaper.png ' to where your background is saved, nd if you change your theme you will have to repeat this. Simple as that... hope this helps people with the same problem  ....
Colonel-1990.
|
|
|
|
02-21-2005, 12:12 PM
|
#8
|
|
Member
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827
Rep:
|
yeah, thats a simplification of what my examples do.. Editing several themes by hand just gets annoying after a while without automation.. (:
|
|
|
|
02-21-2005, 05:27 PM
|
#9
|
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Rep:
|
I found in some Fluxbox FAQ that you can set a default background for all themes by editing/adding the following line to .fluxbox/init:
Code:
session.screen0.rootCommand: bsetbg ~/files/images/image.jpg
|
|
|
|
02-21-2005, 06:15 PM
|
#10
|
|
Member
Registered: Feb 2005
Posts: 71
Original Poster
Rep:
|
Yeah you can do that, but the problem is... is doesnt store the background, when you exit X or reboot it puts the standard background of the theme back on... so there is a few ways to get around this, the simple way i found which i explained firther up, and Artanicus's slightly more complex way, and i would think there are even more, just depends what people find easiest really.
Hope this helps some people  ,
Colonel-1990.
|
|
|
|
02-21-2005, 06:24 PM
|
#11
|
|
Member
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944
Rep:
|
That's interesting, that doesn't happen to me on either the old (0.1) or new (0.9) version of Fluxbox. I've always set the default background there and ignored whatever was in the theme definition, and it always stays through reboots, etc.
|
|
|
|
03-06-2005, 07:31 PM
|
#12
|
|
Member
Registered: Mar 2005
Location: NJ - US
Distribution: Slackware
Posts: 93
Rep:
|
i changed the line rootComand: in usr/X11R6/share/fluxbox/styles/Nyz to fbsetbg -f ~/mypicture.jpg and works fine..... everytime i open startx i get the wallpaper...
|
|
|
|
03-07-2005, 07:07 AM
|
#13
|
|
Member
Registered: Feb 2005
Posts: 71
Original Poster
Rep:
|
Yep thats what i do jp-lack, think i explained firther up. Works fine for me, just got a few problems with my linux atm that i cba sorting yet  .
Colonel-1990.
|
|
|
|
03-07-2005, 09:27 AM
|
#14
|
|
Member
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740
Rep:
|
Go into your ~/.fluxbox folder. Now create (with a text editor) a file called startup , and in this just add the line to set your wallpaper, (fbsetbg -l for me). Then to start fluxbox instead of using fluxbox use startfluxbox (i.e. in .xinitrc use startfluxbox to start fluxbox), this just runs the ~/.fluxbox/startup script. fbsetbg -l will set the last wallpaper you set with fbsetbg. You have to start fluxbox at the end of the script though.
An example of my ~/.fluxbox/startup
Code:
#turn off annoying beep
xset -b
#set last wallpaper and start idesk
fbsetbg -l && idesk &
#set volume to audible level ;)
aumix -v85 -w70 &
#start fluxbox
exec /usr/bin/fluxbox
Last edited by 95se; 03-07-2005 at 09:30 AM.
|
|
|
|
03-07-2005, 11:03 AM
|
#15
|
|
Member
Registered: Feb 2005
Posts: 71
Original Poster
Rep:
|
Why not just do what we said before, and then you dont have to go through complicated things like that?, suppose theres many ways to do it though.
Colonel-1990.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:43 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|