Wednesday, March 4, 2015

Install Django for Ubuntu

Assuming you have python installed, you can install Django with this command:
  • sudo apt-get install python-django
You can check that Django is installed by checking its version:
  • python -c "import django; print(django.get_version())"

Monday, March 2, 2015

Ubuntu: Remapping Right Ctrl with Right Alt

Ubuntu uses xkb to handle its keyboard mapping. You can read more about it here:

  • https://wiki.archlinux.org/index.php/Keyboard_configuration_in_Xorg

Because I use the CTRL key a lot, I want it to be easier to access. Since I always use the ALT key with my left hand, I decided to switch the right ALT key with the Right CTRL key.

To do this, I opened 10-evdev.conf as an admin:
  • sudo pico /usr/share/X11/xorg.conf.d/10-evdev.conf
and added the following to the file:

Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbModel" "pc104"
        Option "XkbOptions" "ctrl:rctrl_ralt,ctrl:ctrl_ralt"
EndSection
Restart your computer to verify your changes.

As you can see, most of the setting is for the keyboard. The most important thing is the second to last line, Option "XkbOptions" "ctrl:rctrl_ralt,ctrl:ctrl_ralt". This states that I want to right CTRL key as right ALT key and vice versa. You see more xkb options in the base file (start on line 692):
  • /usr/share/X11/xkb/rules/base.lst

I haven't tried it, but you can probably switch the caps lock with the control key with ctrl:swapcaps

Resource: