From: Jamis Buck Date: 2004-03-26T02:23:23+09:00 Subject: Re: Detecting hardware with Ruby Jason Voegele wrote: > I solved this problem by using init scripts. I have two init scripts > called setup_home and setup_work. These scripts copy alternate versions > of configuration files depending on whether I'm at work (attached to > external monitor, keyboard, etc.) or at "home" (unattached laptop). I > have one of these two scripts start depending on the runlevel. I can then > choose a run level at boot time, which is very easy with GRUB, and these > scripts will choose the right settings for me. Ah, much nicer. I've got a custom runlevel already for booting without X--don't know why it didn't occur to me to do this for booting with a different X server layout. Thanks, Jason! This will do nicely. I may still try to experiment with the hardware detection route... just for fun... ;) -- Jamis Buck jgb3@email.byu.edu http://www.jamisbuck.org/jamis ruby -h | ruby -e 'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a << r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"'