Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
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.
Is there any way to disable the keyboard from the command line?
I'm looking for something that would have the same effect as physically unplugging the keyboard, without actually doing it.
(The reason I'm trying to do this is to have my computer's monitors go to sleep at night, and not be able to be woken up by hitting keyboard keys. I already disabled the mouse waking them b/c I want the monitors off until a script turns them on in the morning.)
If the main issue is that you want to control what hours of the day the monitors are powered on, a very low tech but incredibly effective way of doing this is to just buy some timers and plug the monitors into them. It's not fancy but it will definitely do the job. -- J.W.
avarus,
the "nohup cat /dev/tty0" was very effective at disabling all keyboard input, so that worked, but unfortunately hitting a keyboard key still woke up the monitors even though it had no effect otherwise.
J.W, that would work, I suppose, but is beneath my geekly dignity ;-)
--aka I'm too lazy and broke to go buy things.
Just out of curiosity, why is it so important that the monitor remain dark during certain hours? Assuming that you've got your monitor set to operate in power saving mode, then even if someone did press a key, the monitor would only be on for X minutes until it goes dark again, and as long as you've got a password-protected screensaver, the only thing on the display would be the logon box and the screensaver pattern.
Is this question being asked because you are attempting to make the system more secure? If so, there are much more effective ways to do it. I guess I'm just puzzled as to what factors cause this issue to be important. -- J.W.
If truth be told, I have a bit of an internet-addiction problem. If I'm not careful I'll be up surfing til 4 or 5 am, which is obviously not good when I have 9 am classes (I'm a student.)
I decided to set myself a bedtime, and to use cron to enforce it to some extent -- more than just a reminder or popup which I would ignore. I found how to use dpms to turn off the monitors, but that's not much of a deterrent when a simple wave of the mouse would turn them back on.
Now that I have sound muted and the mouse and keyboard disabled until morning (cron wakes everything up again,) it's really enough of a solution, I guess. I'm still trying for the completeness of the thing, and because I'm curious, because it must be achievable.
(I went far enough to set /etc/nologin, so that I couldn't just hit the reset switch to get around this -- not that I'd actually do that, but again to have a thorough implementation. )
the gotosleep script:
Code:
#!/bin/sh
mute
xmms-shell -e stop
gaim-remote away
/usr/kde/3.3/bin/dcop kopete default setAway
sudo /etc/init.d/gpm stop
sudo nohup cat /dev/tty0 > /dev/null&
/usr/X11R6/bin/xset dpms force off
sudo sh -c 'echo "Wait until morning, bucko" > /etc/nologin'
#ensure that boinc and valknut run through the night
if [ "`ps x | awk '/boinc/ {print$5}' | grep -v awk`" = "" ]; then /home/kundor/bin/boinker; fi
if [ "`ps x | awk '/valknut/ {print$5}' | grep -v awk`" = "" ]; then /home/kundor/bin/valker; fi
and wakeup:
Code:
#!/bin/sh
sudo /usr/sbin/alsactl restore
xmms-shell -e "jump 2490; play"
gaim-remote back
/usr/kde/3.3/bin/dcop kopete default setAvailable
sudo rm /etc/nologin
/usr/X11R6/bin/xset dpms force on
sudo killall cat
sudo /etc/init.d/gpm start
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.