[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Detecting hardware with Ruby
From:       Jamis Buck <jgb3 () email ! byu ! edu>
Date:       2004-03-25 13:57:06
Message-ID: 4062E51C.5040101 () email ! byu ! edu
[Download RAW message or body]

Here's a rather off-the-wall question: how would I go about detecting 
the presence of external hardware in Ruby? Specifically, sometimes my 
laptop is attached to an external monitor, and sometimes it isn't. Just 
before X starts, I'd like to have a Ruby script that runs and checks to 
see if the monitor is present, and if it isn't, chooses a different 
server layout from the XF86Config file.

Or is there already a solution to this that I haven't found?

Thanks. :)

-- 
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"'

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic