Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
New to LQ.org and fairly new to Linux, so sorry for the basic question and my lack of understanding. I have a Acer AspireOne running "Limpus Lite" based on Fedora 8 and using XFCE4 desktop environment. The question is, how do I make the xscreensaver daemon run automatically on logon?
I have been reading around for about a week and have tried a number of things but to no avail. I have tried using the xfce4-autostart-editor but this doesn't appear to do anything, nor does adding a line to the /etc/rc.local script which reads:
Code:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
setpci -d 197b:2381 AE=47
/usr/local/bin/acerfand
/usr/bin/xscreensaver &
Without this xscreensaver is not running in the background, and when I start the xscreensaver-demo app I get the message "The XScreenSaver daemon doesn't seem to be running on display ":0.0". Launch it now?"
Can someone please suggest a reason for this not working from rc.local, or suggest the proper way of autostarting the xscreensaver daemon?
Hi Chris, thanks for your reply. I will try editing the .bash-profile file as you suggested however would you mind giving me a brief explanation of what the if statement is doing? (Just so that I know, for future reference - I have basic knowledge of some programming but that's it!)
1. The TERM flag depends on your your TTY. Thus if you log in VT1 (CTRL+ALT+F1)
$ echo $TERM
linux
This avoids launching the screensaver on a VT1, and therefore errors. Acturally it does not protect you from logging in as a different user and then switching back to the first user on a Terminal Emulator on VT7 (or wherever your X runs).
$ login: user2
$ su - user1
so I modified the first line as follows:
Quote:
if [ "$(tty)" == "not a tty" ]
2. The "cat" line was just a way to show what is in a file, like "type" in dos, so:
$ cat .bash_profile
shows you what you have written in .bash_profile
3. The purpose of .bash_profile is slightly disto-dependent, but in general it generally gets executed immediately after you log in.
4. rc.local is executed before you log in. The computer does not know where and to whom it should launch the xscreensaver, so it fails.
Just an additional comment/question because all this should not be necessary with XFCE.
I would assusme that if something works on a basic distro like my Slack it should work on Limpus. Do you get a small window prompting you to save your session (or otherwise) when you log out from XFCE? In theory, all you need to do is start once the xecreensaver daemon, then save you session. If you do not get prompted, then check under the Settings >> Session and Startup >> Genral (Tab) >> Prompt on logout (or Automatically save session on logout) menu.
Also I do not do any programming, but I have some basic knowledge on shell scripting... it helps.
Sorry Chris, I think you lost me a bit with TTY, VT1, VT7 but not to worry. The "if [ $TERM != linux ]" line worked for me so I might just leave it at that.
I presume, therefore, that the .bash_profile file is user specific (also because I found it residing in /home/user) - is this correct? So if I had multiple users I would need to recreate the xscreensaver code in each .bash_profile file?
I understand now why the command did not work in the rc.local file.
With regard to saving the session, no I have never had a prompt asking me if I want to save the session. Also, if I go to Settings >> Sessions and Startup Settings (by right-clicking on the desktop), I get an error which reads:
"Xfce Settings Manager error: No such plugin "session""
I don't know what you know about Linpus OS supplied with the Acer Aspire One, but out of the box it is very much locked down, providing the general user a basic but functional environment. After reading a fair bit on the internet I have been able to enable the "advanced mode" to get to the right-click context menu, find the package manager, turn on a login screen, enable Compiz WM, change desktop icons and shortcuts to other apps, amongst amongst other 'fun' little tweaks. Hence I have learned what type of DE lay behind the scenes and got a feel for the many different flavours and distros of Linux out there. Btw, I discovered Ubuntu a while back which I am running (dual-boot) on my desktop. I guess the point of all this is that I guess there should be a Xfce session manager that would allow me to change session settings, but it doesn't appear to be working/installed.
As you said, some basic knowledge in shell scripting is very useful, but I currently have none. This is obviously where should start reading properly :-) (Can you suggest a good resource as a starting point?)
As you said, some basic knowledge in shell scripting is very useful, but I currently have none. This is obviously where should start reading properly :-) (Can you suggest a good resource as a starting point?)
While this is possible, is not just easier to just use whatever mechanisms your wm has to autostart programs?
If my memory serves correctly, for fluxbox it's ~/.fluxbox/startup. For kde it would be ~/.kde/Autostart... just check the docs for your wm.
If you use "startx" to launch your wm or desktop you could also use ~/.xinitrc.
As I said I am learning all the time with this by playing around (breaking things and learning how to fix them - my usual style!), so I only know about the mechanisms I have come across so far. In Xfce I found a "autostart-editor" tool which appeared to be what I needed, but I found it didn't work. It does contain a lot of the apps that are running from bootup such as network manager, keyboard/input manager, battery meter etc. but adding an entry for xscreensaver failed. I wonder whether that's because xscreensaver seems to be a user-specific program?
I have found an "autostart" directory somewhere on the system (I've currently forgotten where that was) but I didn't know what to do with it. As you can tell I'm still and absolute beginner!
I presume, therefore, that the .bash_profile file is user specific (also because I found it residing in /home/user) - is this correct? So if I had multiple users I would need to recreate the xscreensaver code in each .bash_profile file?
Yes, .bash_profile is user specific. Actually it does not have to be!
Just copy it in /etc/skel/ and new users you define will inherit it automagically.
I apologize if my explanation was un-intelligable, but maybe this is not the right media to learn about Terminals and stuff or maybe I am not the right person.
I do not know anything about Limpus except what I read on distrowatch.com. I must say that from what you are writing I am not very impressed as there are great XFCE distros, like Debian Xfce, Xubuntu, Vector and Zenwalk etc (and even Slackware) but none of these is based on Fedora.
Chris
P.S. Apologies to all the other great XFCE distros I did not mention.
Last edited by ChrisAbela; 05-21-2009 at 02:23 AM.
Actually, it turns out there is already a .bash_profile file in /etc/skel but I tried putting the same code in this one and I'm not sure that it worked. Ah well, you solved my problem anyway so I'm happy, thanks again.
With regard to Linpus and other xfce based distros, I'm sure there are some much more "user-friendly" versions, that are nicer (and safer!) for intrigued newbies like myself. The trouble is I just can't bring myself to ditch it on my Aspire One yet, since it does work with the hardware perfectly, so despite it being rather clunky I'd rather live with it, learn with it than expend a lot of effort starting from scratch with something that would operate slicker but wouldn't function with the hardware as well. I've read a bit of stuff about people rushing into putting Ubuntu on it and ending up with broken hardware functions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.