howto "blind type" on Ubuntu; or just an interesting use of vbetool
how to turn off your screen regardless of what you do on the keyboard or mouse
Well, for several reasons.
- Because you want to practice your typing skills.
- Because you need to type important things in a crowed space and you don't want others to see what youíre typing.
- Because youíre taking notes of your dreams at night and you donít want the light of the screen to wake you further.
- Because you like testing crazy things.
First you have to install vbetool.
Find it on the Ubuntu Software Center or type the following on the command line:
sudo apt-get install vbetool
Now you have to do several things. First, vbetool can only be run as root. So you have to add the command to the sudoers as a no password command.
From here (credit to whom the credit is due) we learn how to
So, in this case, you need to run on the terminal
Use the NOPASSWD directive
You can use the NOPASSWD directive in your /etc/sudoers file.
If your user is called user and your host is called host you could add these lines to /etc/sudoers:
user host = (root) NOPASSWD: /sbin/shutdown
user host = (root) NOPASSWD: /sbin/reboot
This will allow the user user to run the desired commands on host without entering a password. All other sudoed commands will still require a password.
Use the command visudo to edit the sudoers file to make sure you do not lock yourself out of the system Ė just in case you accidentally write something incorrect to the sudoers file.
Using /etc/sudoers.d instead of modifying /etc/sudoers
As an alternative to editing the /etc/sudoers file, you could add the two lines to a new file in /etc/sudoers.d
This is an elegant way of separating different changes to the sudo rights and also leaves the original sudoers file untouched for easier upgrades.
Again, you should use the command visudo to edit the file to make sure you do not lock yourself out of the system:
sudo visudo -f /etc/sudoers.d/shutdown
This also automatically ensures that the owner and permissions of the new file is set correctly.
And we add there
sudo visudo -f /etc/sudoers.d/vbetool
save the file. If everything is ok, weíre almost done.
your_user your_host = (root) NOPASSWD: /usr/sbin/vbetool
So now what?
Just add this 2 commands as 2 separate keyboard shortcuts. You can test the commands without that, but once you blank your screen, you will feel lost and won't know how to turn it back on. Thereís a trick though, donít worry.
To add keyboard shortcuts refer to your favorite Ubuntu flavor how to do it. Iím on Lubuntu, so I have to edit a file by hand. Iíll not enter on details about that here, there are other howtos here on how to achieve that.
As for the commands, to turn off add as shortcut:
And to turn it back on:
sudo vbetool dpms off
But hey, I know youíre like me and you want to try the commands without the shortcuts. Go on and blank the screen. HOW DO I TURN IT BACK ON?!? (c'mon, don't do it)
sudo vbetool dpms on
If you have a keyboard shortcut to suspend your computer, suspend the computer. Then wake him up. The screen will be back on again.
Enjoy your your new blind typing machine and write your dreams with the new found pen of your imagination.