The Caps Lock key is an evil remnant of the hardware implemented typewriter. Today it appears to be mostly used for SHOUTING in the seedier sections of the net, like the comments on certain YouTube videos. Less said the better.
I want to use it for a third Control key like civilized people.
According to keyboard(5), the file to fiddle with might be /etc/default/keyboard
The way I found that out is by using the man command for keyboard, like this:
pi@raspberrypi ~ $ man keyboard
The (5) indicates that keyboard is in section 5 of the Unix manuals and describes a file format (this convention goes way back to the early 1970s). The sections are
1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
In the examples of keyboard(5) we see that we can add "ctrl:nocaps" to XKBOPTIONS.
But first we make a backup:
pi@raspberrypi ~ $ cd /etc/default/
pi@raspberrypi /etc/default $ sudo cp keyboard keyboard.orig
Then we edit the file keyboard :
pi@raspberrypi /etc/default $ sudo vi keyboard
and change it to read (in part):
XKBOPTIONS="terminate:ctrl_alt_bksp,ctrl:nocaps"
The we reboot:
pi@raspberrypi ~ $ sudo reboot
Happy Happy Joy Joy! The Caps Lock is gone! It even works when I launch X and start an LXTerminal. Wonderful.
Monday, July 22, 2013
Sunday, July 21, 2013
Let there be /boot/config.txt
So I'm trying to get my display (an LG M2352T-PZ - 23" Full HD IPS LED-TV and computer monitor that I bought here in Sweden at SIBA) to display a full 1920x780 through HDMI. Your monitor might be different, so beware!
I'm using the NOOBS_v1_1 distribution for the Raspberry Pi, and I think the current one is NOOBS_v1_2 and I think the 1.2 handles this better, but I don't want to reinstall everything from scratch every time a new version arrives. Besides, I want to understand how this works.
There is a critical file in the /boot partition called config.txt that apparently sets up the frame buffer. There is a description at RPiconfig - eLinux.org that explains how it works. When I run vcgencmd to probe values I get:
pi@raspberrypi /boot $ vcgencmd get_config int
disable_splash=1
temp_limit=85
force_pwm_open=1
second_boot=1
pi@raspberrypi /boot $ vcgencmd get_config str
pi@raspberrypi /boot $
Note that there are no "str" keys to be shown. Now I want to fiddle with these values, but first I want a copy:
pi@raspberrypi /boot $ sudo cp config.txt config.txt.bak
Then I edit the file:
pi@raspberrypi /boot $ sudo viconfig.txt
and I add the following lines:
framebuffer_width=1920
framebuffer_height=1080
hdmi_force_hotplug=1
and I save and reboot. I have CRL-ALT-DEL set to reboot, and rebooting into shell, not directly into X. I log in as pi and do a startx.
My monitor says 16:9, 1080p at 60hz and is able to render perfectly all the way to the edges. Looks like it worked! (I have redacted a stupid mistake where I put in 780 instead of 1080. Oh well.)
I have no idea how much this traded off frame buffer for available RAM, but that is for future discovery.
hdmi_force_hotplug=1
I'm using the NOOBS_v1_1 distribution for the Raspberry Pi, and I think the current one is NOOBS_v1_2 and I think the 1.2 handles this better, but I don't want to reinstall everything from scratch every time a new version arrives. Besides, I want to understand how this works.
There is a critical file in the /boot partition called config.txt that apparently sets up the frame buffer. There is a description at RPiconfig - eLinux.org that explains how it works. When I run vcgencmd to probe values I get:
pi@raspberrypi /boot $ vcgencmd get_config int
disable_splash=1
temp_limit=85
force_pwm_open=1
second_boot=1
pi@raspberrypi /boot $ vcgencmd get_config str
pi@raspberrypi /boot $
Note that there are no "str" keys to be shown. Now I want to fiddle with these values, but first I want a copy:
pi@raspberrypi /boot $ sudo cp config.txt config.txt.bak
Then I edit the file:
pi@raspberrypi /boot $ sudo viconfig.txt
and I add the following lines:
framebuffer_width=1920
framebuffer_height=1080
hdmi_force_hotplug=1
and I save and reboot. I have CRL-ALT-DEL set to reboot, and rebooting into shell, not directly into X. I log in as pi and do a startx.
My monitor says 16:9, 1080p at 60hz and is able to render perfectly all the way to the edges. Looks like it worked! (I have redacted a stupid mistake where I put in 780 instead of 1080. Oh well.)
I have no idea how much this traded off frame buffer for available RAM, but that is for future discovery.
Update 2013-07-23:
For the observant ones who noticed that I also set:
hdmi_force_hotplug=1
This is to always use the HDMI output. The default is to probe the HDMI to see if it is connected and otherwise default to the standard video output. This is problematic for me as I always use HDMI, but sometimes the TV/Monitor isn't on, or it has timed out and is in power saver mode (the timeout is stupidly short, 30s or something if there is no input on the selected HDMI input.) This way I can turn the Raspberry Pi and the TV in any order and it still works.
fbset
I also came across a command for probing (and fiddling with) the frame buffer. Check out fbset(1). This is what I get after the above changes to config.txt:
pi@raspberrypi ~ $ fbset
mode "1920x1080"
geometry 1920 1080 1920 1080 16
timings 0 0 0 0 0 0 0
rgba 5/11,6/5,5/0,0/16
endmode
Friday, July 19, 2013
In the beginning...
In the beginning, I bought a RaspberryPi for my son. Then I bought one for myself. Then I started to play with it.
Wow.
It brought back much of the love I had for my Apple ][ back in 1977. Such potential, yet unfinished.
As I'm starting to fiddle with it, I realized that I really need to keep track of what I'm doing, or it will just become a blur after a month or two, so I started this blog.
Don't expect My Piberry to be organized, readable, or coherent. It is just a stream of consciousness/log of what I'm doing with it and related stuff. There might be some Arduino and robotics thrown in, and probably some Mac OS/X stuff as that's the machine I use day to day.
Wow.
It brought back much of the love I had for my Apple ][ back in 1977. Such potential, yet unfinished.
As I'm starting to fiddle with it, I realized that I really need to keep track of what I'm doing, or it will just become a blur after a month or two, so I started this blog.
Don't expect My Piberry to be organized, readable, or coherent. It is just a stream of consciousness/log of what I'm doing with it and related stuff. There might be some Arduino and robotics thrown in, and probably some Mac OS/X stuff as that's the machine I use day to day.
Subscribe to:
Posts (Atom)