LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having 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


Reply
  Search this Thread
Old 02-20-2007, 11:26 AM   #1
robrecc
Member
 
Registered: Feb 2002
Posts: 50

Rep: Reputation: 15
work xorg and home xorg


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
 
Old 02-20-2007, 12:33 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
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.
 
Old 02-20-2007, 01:10 PM   #3
robrecc
Member
 
Registered: Feb 2002
Posts: 50

Original Poster
Rep: Reputation: 15
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
 
Old 02-20-2007, 01:23 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
That's actually pretty trivial. What where you looking for? There's no existing/automatic method of switching xorf.conf files at boot.
 
Old 02-20-2007, 01:29 PM   #5
robrecc
Member
 
Registered: Feb 2002
Posts: 50

Original Poster
Rep: Reputation: 15
What about some sort of startup script. That detects my IP or ask me whether im at home or work then uses the xorg corresponding to what i answer
 
Old 02-20-2007, 01:39 PM   #6
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
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.
 
Old 02-20-2007, 02:44 PM   #7
robrecc
Member
 
Registered: Feb 2002
Posts: 50

Original Poster
Rep: Reputation: 15
well home ip would always be 192.168.1.110 and work ip would always be 192.168.15.12

the name at work is xorg.conf
what would i name my xorg.conf for my home
 
Old 02-20-2007, 03:02 PM   #8
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
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
 
Old 02-21-2007, 05:45 PM   #9
redwing57
Member
 
Registered: Jan 2005
Location: Yorktown, VA
Distribution: CentOS, Ubuntu, MEPIS
Posts: 30

Rep: Reputation: 15
another idea

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.

Rob
 
Old 02-21-2007, 05:59 PM   #10
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
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.
 
Old 02-21-2007, 09:09 PM   #11
redwing57
Member
 
Registered: Jan 2005
Location: Yorktown, VA
Distribution: CentOS, Ubuntu, MEPIS
Posts: 30

Rep: Reputation: 15
Good point.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
xorg screen res not being set properly with Xorg 6.9.0 sgnome Linux - Laptop and Netbook 2 06-12-2006 02:26 AM
recent dist-upgrade of xorg has killed my mouse (and thusly, xorg). Lokathor Debian 4 06-10-2006 04:52 AM
replace 'xfree86' by 'xorg' in your xorg config file dindoung Linux - Newbie 2 02-26-2005 04:43 AM
Xorg Hard Crashes and corrupts xorg.conf Advocator Linux - General 0 07-15-2004 01:41 PM
Considering Xorg, Slack favors Xorg over Xfree Nichole_knc Slackware 7 06-13-2004 06:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 06:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration