topic title: symlinks
Posts: 1,081
OU812
Joined: 29 Sep 2007
#1
Hello. Anti and I would like to have different wallpapers for each wm. I wrote to the author of nitrogen to see if this was possible. This is what he sent me:
nitrogen itself does not support such a thing, it always looks in
~/.config/nitrogen/bg-saved.cfg for the list of items to restore. I
could perhaps modify nitrogen so that it will accept an argument to tell
it where to look for the saved items, but this is a rather specific use
that not many other users will have.

I have an idea that might work (outside of nitrogen). You could
maintain two separate files in ~/.config/nitrogen, named
bg-saved-icewm.cfg and bg-saved-fb.cfg, and in the startup scripts for
each of the different wms, create a symbolic link from the existing file
to bg-saved.cfg. That way, nitrogen will always read the correct file
for which wm you are in, and it also has the added bonus of being able
to just run nitrogen normally and have any changes saved to whatever
file is currently symlinked to bg-saved.cfg.
I get what he's saying, but I don't know how to do the symlink part. Any ideas?

john
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#2
I think I understand him but I will need to download the iso and check out the script before I can be sure. I will try to figure it out.
Posts: 1,081
OU812
Joined: 29 Sep 2007
#3
Well, through a lot of trial and error, I think I got the symlink thing figured out (well, there is more than one way to create a symlink and I've figured out two of them). So I created a symlink in the icewm startup script to the nitrogen config file, and a similar symlink in the fluxbox startup file. Then I logged in to icewm and used nitrogen to set the wallpaper. Unfortunately, even though I was in icewm, changing the wallpaper in icewm affected all symlinks to the nitrogen config file; i.e., the fluxbox symlink was affected also. So, I don't know if it's possible to have nitrogen set two different wallpapers. Also, I haven't had further contact from the developer of nitrogen for other avenues to explore. (The only thing I could still do is check the goblinx livecd and see how they managed to get different wallpapers for each of their window managers.)

There is one other possibility, at least for now. Since fb is the default wm of this distro, put

Code: Select all

nitrogen --restore &
in the fluxbox startup file. This will reflect any changes a user makes using the control center.

For icewm, have this statement included in the startup file but commented out. Also include in the comments that uncommenting will result in both wm's using the same wallpaper. So that means that the default style in icewm - AntiX - will be used to display the"default" wallpaper.

There is one or two more experiments I am willing to try. If they don't work, then we'll have to use the aforementioned approach and live with the"side-effects."

john
Posts: 1,520
eriefisher
Joined: 07 Oct 2007
#4
What about Gsetroot for handling wallparer?
Posts: 1,081
OU812
Joined: 29 Sep 2007
#5
gestroot, esetroot, xli are not included on the iso. However, feh is. This should probably be used since it's already on the iso and the way themes in icewm can display wallpapers is not ideal.

john
Posts: 61
thinkpada21
Joined: 13 Sep 2007
#6
It is possible that nitrogen does something like:

Code: Select all

mv bg-saved.cfg bg-saved.cfg.bak
to make a back up of the previous settings. Usually this is a good thing, however, with bg-saved.cfg as a symbolic link to another file, it just defeats the purpose of the symlink.

You could write code that checks if bg-saved.cfg is still a link. If it is not:

Code: Select all

mv $x $x.bak; mv bg-saved.cfg $x
where $x is set to what bg-saved.cfg.bak points to, will fix it.