Inserting a block of text into a text file on system boot
Ok what I want to do is set the program xscreensaver settings upon loading linux.
Problem is this has to be done through a shell script and I am mainly a windows user. Can anyone help me figure out how to do this in linux? can I simply put quotes around the entire block of text with \n at the end of each line? This wouldn't be ideal so I hope there is an easier way. Please let me know. |
Well,
There are a couple of questions that I would have in regards to this:
Now, the reason for these questions is because the way that xscreensaver works, the configuration for how xscreensaver will run will be stored in the user's home directory in a file called .xscreensaver. If you want a default configuration for each new user created on the system, you can add an .xscreensaver config file to /etc/skel/ so that each new user created will have the default config in their home directory. You can add the starting configuration to the /etc/profile file as I suggested above, but if the user has his own config file, I am pretty sure it will override any "global" settings for their session when they log in. Now, if you want this to be the configuration for how xscreensaver will run when no one is logged in, then you can try adding the settings/command to the /usr/lib/X11/<display manager sub-directory>/Xsetup_0 file. I have had mixed results doing this with xdm. On some systems it works well, others it never starts xscreensaver. (Pretty sure that has to do with an issue regarding running the *dm as root and the system not wanting to run xscreensaver as root.) So, I hope that helps and let us know. |
Quote:
2. I am using kdm and KDE4. 3. The information will be static, so one config file globally. 4. I wish to be able to do that, however I can't. I want to load it upon system booting, outside of the Xserver. I am currently using SuseStudio to build my machine. I want those settings to be set statically upon each "Testdrive" of my build. Check out www.susestudio.com to find out more on that. |
Okay,
Actually, I am a little familiar with SuSEStudio. SuSE has had great booths at the last 2 SCaLE expos. :) They set up SuSEStudio kiosks. Just out of curiosity, are you making this a cloud appliance, USB stick, VM or live cd/dvd? Okay, what you are going to want to do to start with is this:
Now, to make sure it's the default for any user that's created, you want to put a copy in /etc/skel/. On the OpenSuSE appliance, add it as an overlay file from the Files tab. I hate to say it, but a startup script won't really work with what you are trying to do because you have to rely on the X server to start before you have a display for the xscreensaver daemon to bind to. Fortunately, the different desktops (I use Gnome.) each have their ways of setting their defaults, as does kdm, gdm and xdm. Now, from the xscreensaver docs: Code:
USING KDE Code:
[Desktop Entry] (SIDE NOTE: If you are using windows as your primary system, you may want to get an app like Notepad++ or Metapad to paste into, so you can control the way the line-feeds are written. Some shells have an issue with the CR/LF that windows puts in with Notepad.) Now, one last question: Are you trying to run xscreensaver as the background for kdm, too? Let us know. |
Quote:
I am creating an OpenSuse Appliance server. This server will be an xserver for allowing remote connections from other PC's on the same network. (new topics will be created for help on this.. I am stuck in a few areas because of my choice to use KDM and not XDM. Even though KDM loads config files for XDM... ) I will then create a seperate appliance for the PC's that will be connecting to the server. This appliance will simply just connect to the server upon booting up. As I was checking more into the config files, it looks like KDM allows autologins as well, this will be handy. 2. Im not sure how I would know if xscreensaver is running as the background for KDM. I am primarily a Windows user, so background to me in this case would imply a live wallpaper of some sort. On a more technical level I am thinking xscreensaver has some ability to be a backup screensaver incase KDM fails. Can you please explain that question for me? Thank you for your help. The information supplied has actually helped me more than you would think. I was able to learn how one can load global settings. Can you explain a little more on the autostart file. I see that you can add a .desktop extention, but does that create it as a desktop icon? because I seen a mycomputer.desktop file and I figured that to be the icon file for the KDE desktop to access the computer file system. Where do you store the autostart files? Do have more information on this outside of the thread? |
Okay,
Let's take these in order:
Well, I hope that helps out. Let us know. |
All times are GMT -5. The time now is 06:41 PM. |