Linux - Laptop and NetbookHaving a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).
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.
I have a laptop i use at work that I have xorg.conf setup to use both monitors. When I take the laptop home with me and i try to boot the screen just stays blank due to the xorg being totally wrong. I have tried to hit function f8 but the screen still stays blank. Is there anyway around this that I can switch from home-xorg.conf to work-xorg.conf. or is there a easier way
You can use a USB key. If the key is plugged in, then you are at work, if not you are at home. You can then check in your rc.local and copy the appropriate xorg, so that when X starts you have the correct display configuration.
Even better, you can have a configuration file on the key that you parse and set appropriate options. One key for each environment. Even the smallest capacity key would be fine - many places give these little keys away as freebies, or you can sometimes find them at the local dollar store.
is there a easier way to get it done than that. I dont understand why i would need a usb key. what files would the usb key have on it. I basically saying I dont understand the answer that was provided
There are no pre-existing scripts that I'm aware of for your specific situation. They are not difficult to write, but usually folks just create something for themselves.
If you are using static IP addresses (or subnets), you can certainly use that to create a script (your rc.local) that will select the appropriate xorg.conf. It's only a few lines of code... what are the names of your two xorg.conf files, and what are the home/work IP addresses (first three dotted numbers)? I'll show you what you need to add to your /etc/rc.d/rc.local.
OK, let say you have a file called work-xorg.conf and one called home-xorg.conf, both kept in /etc/X11. In your /etc/rc.d/rc.local you'd have code like this:
Code:
IP=`/sbin/ifconfig eth0 | /bin/grep inet | /usr/bin/awk '{print $2}' | /usr/bin/awk -F: '{print $2}'`
OCTET=`echo "$IP" | /bin/awk -F. '{print $3}'`
if [ "$OCTET" == "15" ]
then
# At work
/bin/cp -f /etc/X11/work-xorg.conf /etc/X11/xorg.conf
else
# At home
/bin/cp -f /etc/X11/home-xorg.conf /etc/X11/xorg.conf
fi
I'm no linux guru, so I think simple. Couldn't you set up your machine to boot to a run level where X doesn't start? Then you could either switch the xorg.conf file, if you need to, or just startx if not. A simple script could be used to copy the appropriate xorg file to xorg.conf and then startx.
What you propose may sound simple, but is actually more complex. Your proposal:
1. One-time setup: Edit /etc/inittab and set the run level to 3.
2. When the machine boots, login as root.
3. Copy the appropriate xorg.conf to /etc/X11
4. Logoff
5. Login as user
6. Run startx to get a GUI
Repeat steps 2-6 at each boot.
My suggestion:
1. One-time setup: Copy the 10 lines in comment #8 to /etc/rc.d/rc.local
Done.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.