Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jan 2002 23:21:17 -0600 (CST)
From:      John Utz <john@utzweb.net>
To:        <freebsd-mobile@freebsd.org>
Subject:   question/idea: mapping 'pccardc power 0 0' (more or less) to a key
Message-ID:  <Pine.LNX.4.33.0201102253540.5559-100000@jupiter.linuxengine.net>

next in thread | raw e-mail | index | archive | help
hi;

as i was riding home on the bus this evening and tabbing tru my various
xterms in ion, i came upon the one that i've su'd to root and keep
upkeying to get 'pccardc 0 0' and 'pccardc 0 1'.

the reason that i do this is because i have a long bus ride and pretty
wretched battery life and i actually cant run my computer all the way to
work if the nic is energized.

it occurred to me that this way of doing it was kinda feeble, and that i
ought to be able to do 'something' that would allow me to just hit a
function key and make this happen.

now, i can think of a couple of hacky ways to do this, but i think that
it's an idea that might be generally useful, so somebody may have done
this already. And if it hasnt been done already i'd like to implement it
robustly so i could share it with others. it would make debugging pccard
code incrementaly less annoying, for instance.

So, as a bit of design rumination, here's what i feel are the constraints:

pccardc cant be run as a normal user, it must be run as root. i do not
want to use a sudo or anything that involves passwords

i assume that pccardc has to be run as root because it's fiddling some
/dev that requires root perms. i do not want to go and change the the
perms on the device. sure, its' my computer and nobody else logs into it,
but that wouldnt be The Unix Way(tm).

the result of these constraints indicates to me that the app would have to
be suid like the X server, am i mistaken? the actual power fiddling code
could get horked straight outta' pccard*, but i am wondering if their are
any 'suidness' programming considerations that i need to consider.

I'd like the key to be the function key that's right next to my power
button and i'd like it to be the same key in from the console or from X.

is this requirement more annoying to implement then it first appears?

Once i start X, X owns the keyboard and what ever control i had over the
keyboard whilst at the console is null and void, yes?

So i'd have to configure my window manager to assign the key all over
again, correct?

i'd love to hear any thoughts, suggestions or existing implementations
that you folks could share.

tnx!

johnu

 --

John L. Utz III
john@utzweb.net

Idiocy is the Impulse Function in the Convolution of Life


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.33.0201102253540.5559-100000>