Customizing Ubuntu for XO
Once you've installed Ubuntu, you may quickly discover that it's not completely ready for you to use. Below are some short How-To's on topics I've seen asked a few times. These instructions are probably posted elsewhere, but I wanted to collect them all in one place.
This is probably the biggest problem users have once the finish installing Ubuntu. XO's root user account has no password and so it's simple to switch to root user using su. Ubuntu doesn't want users to log in as root. They see it as unsafe since as root, you have the power to do anything, including destroy your system. By using su, you gain root power until you decide to give it up. They're worried that you might forget that you're root and accidentally do something bad. So, they disabled directly logging into the root account.
Instead, they provide the sudo command. It runs programs as root without having you actually log in as root. To use it, just put sudo at the very front of your command. For example, if you wanted to install Firefox using apt-get, you would want to type:
apt-get install firefox
but that would fail since you don't have permission. To get permission using sudo, you need to type:
sudo apt-get install firefox
It'll then prompt you for your password (not root's) and run the command with root privilege. Once the command (apt-get in this case) finishes, it'll return, leaving you as olpc, not root.
Now, there is a way to use sudo and su to gain root privilege the way you're used to from Sugar, but I'll leave that as a small exercise for you to figure out ;).
We finally have a fix for this problem, thanks to raduga: http://olpcnews.com/forum/index.php?topic=1585.msg16543#msg16543
Here's what raduga suggested (with some corrections from n2d2 and James_Bucher):
As root, open the /etc/modprobe.d/olpc.conf.dist file and add options mousedev tap_time=0 to the end:
sudo nano /etc/modprobe.d/olpc.conf.dist
Once the file's open, put this at the bottom:
options mousedev tap_time=0
The instructions to save and close are at the bottom of the screen. The carat (^) means Control. So, to output (save) a file, it's ^O, which means hold down Control and press O (that's o, as in output).
In the same thread (The trackpad is killing me! Help! (Ubuntu+xfce)), we found that by messing with the settings for the mouse sensitivity, we could almost get the trackpad sensitivity to a useable level. However, we also discovered that as the firmware number increases, the more sensitive it becomes, so not upgrading past version q2d07 is probably best for now. The settings I use are 1/4 sensitivity and 0 threshold. To set them, open a terminal and type:
xset m 1/4 0
If you want this to execute automatically when Xfce starts, add it to your .xfce4_startup file (/home/olpc/.xfce4_startup). If you don't have the .xfce4_startup file (it should be there if you used the compressed files installation method), see the Creating the Xfce Startup File instructions above.
Changing username and password
Open a terminal and type:
It will then prompt you for your current password. If you used the Compressed Files installation method, the password should be olpcolpc. It will then want you to enter your new password twice (to make sure you typed it correctly).
Changing your username isn't as simple as your password, but, it's not very hard either. Before I begin, here are a couple of conventions: new_username = your new username, whenever you see this, replace it with your new username olpc = this is your current username, if your username isn't olpc, replace it with whatever it is
To start, open up a terminal and type:
sudo usermod -d /home/new_username -l new_username -m olpc
That'll change everything but your password and your group name. Your password can be changed following the instructions above, your group name will take one more step. If you don't want to change your group name, skip the next paragraph.
What are groups? Well, it's part of the file permissions that Linux has. I'll let Wikipedia explain the rest: http://en.wikipedia.org/wiki/Group_identifier_%28Unix%29 . Why bother changing your group name? Well, there's no real need to, but it'd make more sense for your files to belong to the new_username group than to the olpc group. Plus, it's not hard to do. Just type:
sudo groupmod -n new_username olpc
If sudo is installed (if you used the Compressed Files method, it is), we need to change the sudo information, so in a terminal type:
EDITOR=/usr/bin/nano sudo visudo
Scroll down to the bottom of the file and change all the olpc in the first column with new_username. If you changed your group name, be sure to also change the line
new_username ALL=(root) NOPASSWD: /bin/chgrp olpc /sys/class/backlight/dcon-bl/brightness
new_username ALL=(root) NOPASSWD: /bin/chgrp new_username /sys/class/backlight/dcon-bl/brightness
If you changed your group name, open the .xfce4_startup file in your home directory (/home/new_username/.xfce4_startup) and change the line:
sudo chgrp olpc /sys/class/backlight/dcon-bl/brightness
sudo chgrp new_username /sys/class/backlight/dcon-bl/brightness
Note: Throughout the rest of these guides, I'll assume that the username is still olpc.
Running graphical programs as root
I don't know why we're running into this problem, but for some reason the .Xauthority file goes missing, which prevents gksu from running, which ends up with us not being able to run graphical programs requiring root privilege. Luckily, there's a simple fix! Just add, to the bottom of your .xfce4_startup file in your home directory (/home/username/.xfce4_startup):
xauth generate $DISPLAY . trusted
That'll fix the problem once you log out of X, but what about your current X session? Well, you could just log out and start Xfce4 again, but there's another way! Just type in a terminal:
xauth generate $DISPLAY . trusted
Installing new software
There are plenty of ways to do this in Ubuntu, but if you're new to Ubuntu, then I'd recommend the Synaptic Package Manager. it's available from the menu, under the System submenu. It'll hopefully ask you for your password. If it says you don't have permission to run it, see the How-To above. If synaptic isn't installed, you can install it using another installation method: apt-get. The apt-get program is a command-line program. Here's an example of how to use it, that happens to install synaptic. Open a terminal and type:
sudo apt-get install synaptic
Rotating the screen
Thanks to cyli's post in the Xfce? thread, it's now possible to rotate the screen in Ubuntu.
First, you need to install the new driver. Visit this website https://launchpad.net/%7Eq-funk/+archive and search for "xserver-xorg-video-amd" in the search bar towards the bottom. It should come back with one result. Show all the files related to that result (click the triangle next to the source name) and download the xserver-xorg-video-amd_22.214.171.124-1ubuntu2_i386.deb file. Open a terminal, change into the directory you downloaded the file to, and run
sudo dpkg -i xserver-xorg-video-amd_126.96.36.199-1ubuntu2_i386.deb
Finally, download freelikegnu's new xorg.conf file to /etc/X11:
cd /etc/X11 wget http://www.freelikegnu.org/wp-content/uploads/2008/01/xorg.conf
You can rotate the screen by using
xrandr -o 2
to flip the screen and
xrandr -o 0
to return it to normal. info_anarchy and Frihet both wrote scripts that make use of the rotate button:
the keycode for the rotate button can be found with "xbindkeys -k" but it only works for the right gamepad the left arrows and the rotate button dont register... so um.. yeah ..
Mapping the Rocker Buttons
By default, the rocker buttons are not recognized by the kernel. But you can find the keycodes by running the following command in the console while pressing the rocker buttons.
tail -f /var/log/messages
You will see many messages like:
Unknown key released (translated set 2, code 0x65 on isa0060/serio0). Use 'setkeycodes 65 <keycode>' to make it known.
This tells us that the key code for this particular button (Up) is 65. Doing this for all the rocker buttons reveals codes 65-68.
I wanted to map the rocker buttons to the arrow keys so I needed to find the key codes for the arrow keys. The following command will reveal the key code for the up arrow key.
root@xo-ubuntu:~# dumpkeys --keys-only | grep Up keycode 103 = Up
Now we know the keycode is 103 for up. You can also grep for Down, Left, Right to find the key code each arrow key. Issuing the following command will map the up rocker to the up arrow key.
setkeycodes 65 103
This can be repeated for each rocker key by replacing 65 and 103 with the buttons' corresponding numbers.
I added the following lines to the /etc/rc.local to map all the rotator buttons on boot.
#setup rocker pad setkeycodes 65 103 setkeycodes 66 108 setkeycodes 67 105 setkeycodes 68 106
- Beyond the Ubuntu Installation
- The trackpad is killing me! Help! (Ubuntu+xfce)
- Ubuntu: getting X to see the rotation button and directional buttons