My Ubuntu Eee 1011PX setup

Table of Contents

1 Description

This document presents the steps I have taken to set up my Eee 1011PX with Ubuntu 11.10 the way I like it. This document is meant as a reminder to myself, but hopefully at least one other person will find at least one useful fact in it.

Mainly, this document describes how to:

  • Set up fan control and CPU scaling for the Eee 1011PX on Ubuntu 11.10
  • Set up LXDE
  • Set up an Emacs, notmuch, offlineimap and Gmail email system (my current system)
  • Set up an Emacs, gnus, dovecot, offlineimap and Gmail email system (my old system)

2 News

  • 24 May 2014: Added changes required to make it work on Ubuntu 14.04.
  • 1 Feb 2014: Updated the notmuch emacs setup to work with newer versions of notmuch.
  • 24 Feb 2012: Updated notmuch Emacs script to work with current git version
  • 29 Jan 2012: Added description of use-cases to my notmuch email system.
  • 10 Jan 2012: Changed notmuch Emacs script to only remove relevant tags when moving messages.
  • 06 Jan 2012: Added notmuch-Emacs setup binding to automatically refresh message list.
  • 04 Dec 2011: Initial page.

3 Glossary

  • vk: my user name

4 Installing Ubuntu 11.10 on Eee 1011PX

  • Use unetbootin to set up a USB thumb drive as a bootable Ubuntu 11.10 disk
  • Press ESC at bootup to enable boot-selection-screen
  • Install Ubuntu
  • My partition table consist of
    • 50gb as resized initial windows installation
    • 100gb for Ubuntu
    • 150gb (rest) as a ext4 partition to be mounted in /media/data

5 Mount a data partition

sudo mkdir /media/data
sudo chown vk:vk /media/data
sudo mount /dev/sda4 /media/data

Add to /etc/fstab:

/dev/sda4 /media/data ext4 defaults 0 1

6 Set up Emacs

This is extremely specific to my system and .emacs

sudo apt-get install emacs23 emacs23-el
sudo apt-get install auctex wmctrl

ln -s /media/data/backup ~/backup
ln -s ~/backup/homevk/data/git/emacs/.emacs ~/.emacs
ln -s ~/backup/homevk/.emacs.d ~/.emacs.d


sudo apt-get install lxde

7.1 Autostart LXDE

sudo /usr/lib/lightdm/lightdm-set-defaults -s gnome-shell

7.2 Keyboard layouts in LXDE

mkdir -p ~/.config/lxsession/LXDE

Create/add to file ~/.config/lxsession/LXDE/autostart:

@setxkbmap -option grp:switch us,dk

This means the us keyboard layout is active by default. And the danish layout is active while holding down the right alt button.

7.3 Virtual Desktops


Set desktops amount to 6.

Add to ~/.config/openbox/lxde-rc.xml inside <openbox_config><keyboard>:

<keybind key="W-1">
  <action name="Desktop">
<keybind key="W-2">
  <action name="Desktop">
<keybind key="W-3">
  <action name="Desktop">
<keybind key="W-4">
  <action name="Desktop">
<keybind key="W-5">
  <action name="Desktop">
<keybind key="W-6">
  <action name="Desktop">
openbox --reconfigure

7.4 Clear out bindings conflicting with Emacs

Remove everything from work spaces management from file ~/.config/openbox/lxde-rc.xml.

7.5 Start xterm on binding windows-key + t

Add to ~/.config/openbox/lxde-rc.xml inside <openbox_config><keyboard>:

<keybind key="W-t">
  <action name="Execute">
openbox --reconfigure

7.6 Panel date/clock string

%a %e %b %H:%M

7.7 Power button suspends

Add to /etc/acpi/sleepbtn.sh:

# just sleep
exit 0

7.7.1 Ubuntu 14.04 notes

Additional actions are required to make this work in Ubuntu 14.04 because of systemd.

First we need to disable the default handling of power button press. We do this default by adding the following line to /ets/systemd/logind.conf:


After that, we need to change what happens when the power button is pressed. We change this behavior by changing /etc/acpi/events/powerbtn to contain the following:

event=button[ /]power

7.8 Disable double tap

Add to ~/.config/lxsession/LXDE/autostart:

@synclient TapButton2=

7.9 Disable screensaver and screen locking


8 Essential Ubuntu packages

  • ubuntu-restricted-extras
  • build-essential
  • git subversion
  • screen
  • graphviz
  • gnome-do

9 Eee 1011PX fan control and CPU scaling in Ubuntu 11.10

9.1 CPU scaling

sudo add-apt-repository ppa:webupd8team/jupiter
sudo apt-get update
sudo apt-get install jupiter jupiter-support-eee

I have my CPU scaling permanently set to Power Saver to decrease the fan noise.

9.2 Fan control

Edit appropriate line in file /etc/defaults/grub to:

sudo update-grub2
sudo apt-get install lm-sensors fancontrol
sudo sensors-detect

Accept writing to /etc/modules in order to add CPU-cores temperature measurements.

sudo reboot
sudo pwmconfig

It caused errors when I used the CPU-core temperatures. Using the temperature hwmon0 works.

My /etc/fancontrol:

# Configuration file generated by pwmconfig, changes will be lost
DEVPATH=hwmon0= hwmon2=devices/platform/eeepc
DEVNAME=hwmon0=acpitz hwmon2=eeepc
FCFANS= hwmon2/pwm1=

The Eee 1011PX runs quite hot (compared to Eee 901), meaning the fan must always be turning. If I had known this, I would have just bought a new Eee 901.

9.3 Ubuntu 14.04 notes

This setup and fancontrol did not work on my Ubuntu 14.04 setup. This is because the modules eeepc_laptop and coretemp are loaded loaded in a different order when rebooting. Loading modules in a different order changes the hwmon0 and hwmon2 devices in /etc/fancontrol.

I fixed this by manually adding these 2 modules by adding a new file /etc/modules-load.d/sensors.conf containing:


10 Guile 2.0.3

wget ftp://ftp.gnu.org/gnu/guile/guile-2.0.3.tar.gz
tar xzvf guile-2.0.3.tar.gz
sudo apt-get install libltdl-dev libgmp-dev libunistring-dev libffi-dev libgc-dev
sudo make install

11 Gnubiff

I mainly use Gnubiff because it can run a command (offlineimap) when new messages are available on my Gmail account

Gnubiff is no longer an official Ubuntu package so download and install these:

New file ~/.config/autostart/gnubiff.desktop:

[Desktop Entry]
Exec=gnubiff -n --systemtray

The default system tray images are hard to read. I have switched to using the awake penguin when there are no unread messages and the animated dancing penguin when there are.

12 Send mail through Gmail using Emacs

sudo apt-get install gnutls-bin

Add to ~/.emacs:

(setq user-full-name "Dan Amlund Thomsen")
(setq user-mail-address "danamlund@gmail.com")

(require 'smtpmail)
(require 'starttls)
(setq send-mail-function 'smtpmail-send-it
      message-send-mail-function 'smtpmail-send-it
      smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
      smtpmail-auth-credentials (expand-file-name "~/.authinfo")
      smtpmail-default-smtp-server "smtp.gmail.com"
      smtpmail-smtp-server "smtp.gmail.com"
      smtpmail-smtp-service 587
      smtpmail-debug-info t)

Create/add to file ~/.authinfo:

machine smtp.gmail.com login [your name]@gmail.com password [your password]

C-x m

13 Emacs gnus gmail dovecot offlineimap starttls

This setup assumes you have followed the previous steps:

  • Send mail through Gmail using Emacs
  • Gnubiff

13.1 Gmail offlineimap dovecot-imap

sudo apt-get install offlineimap dovecot-imapd

Add to /ets/dovecot/conf.d/10-mail.conf:

mail_location = maildir:~/Maildir
sudo service dovecot stop
sudo service dovecot start

New file ~/.offlineimaprc:

accounts = Gmail
maxsyncaccounts = 1

[Account Gmail]
localrepository = Local
remoterepository = Remote

[Repository Local]
type = IMAP
remotehost = localhost
port = 143
remoteuser = your_local_username
remotepass = your_local_password

[Repository Remote]
type = IMAP
remotehost = imap.gmail.com
remoteuser = your_username@gmail.com
remotepass = your_gmail_password
ssl = yes
maxconnections = 1
realdelete = no

13.2 Setting up Gnus with local IMAP server

Download offlineimap.el into ~/.emacs.d.

Add to ~/.emacs:

(add-to-list 'load-path "~/.emacs.d")
(require 'offlineimap)

(setq gnus-select-method '(nnimap "local"
                                  (nnimap-address "localhost")))
(setq gnus-ignored-newsgroups "")
(setq gnus-permanently-visible-groups ".*")

(add-hook 'gnus-exit-gnus-hook 'offlineimap)

(define-key gnus-summary-mode-map (kbd "C-c m u")
  (lambda () (interactive) (gnus-summary-move-article nil "INBOX.uni")))
(define-key gnus-summary-mode-map (kbd "C-c m p")
  (lambda () (interactive) (gnus-summary-move-article nil "INBOX.personal")))
(define-key gnus-summary-mode-map (kbd "C-c m DEL")
  (lambda () (interactive) (gnus-summary-move-article nil "[Gmail].Trash")))
(define-key gnus-summary-mode-map (kbd "C-c m C-d")
  (lambda () (interactive) (gnus-summary-move-article nil "[Gmail].Trash")))

Create/add to file ~/.authinfo:

machine localhost login [your name] password [your password]

14 Emacs notmuch offlineimap gmail

Note: This section was updated on 1 Feb 2014. The old version of it is available here

This setup assumes you have followed the previous steps:

  • Send mail through gmail using Emacs
  • Gnubiff

14.1 Usage

My process for reading new mail is:

  • Notice Gnubiff dancing tux icon
  • Open notmuch searching for mails tagged as 'inbox' (key: C-c c n)
  • Open each mail, read them, reply and archive them by pressing 'a' Archiving mails marks then as being read on gmail the next time offlineimap is run

My process for reading old mail is:

  • Open notmuch main menu (key: C-c c g)
  • Select the "week" saved search that shows mails send in the last week.
  • Or in rare cases where that won't work. I write a search string.

My process for sending mail is:

  • Find old mail and press 'r' to reply.
  • Or make a new mail using (C-x m) (<tab> completes addresses fetched from old mails).

14.2 Initial setup

14.2.1 offlineimap

sudo apt-get install offlineimap

New file ~/.offlineimaprc:

accounts = Gmail
maxsyncaccounts = 1

[Account Gmail]
localrepository = Local
remoterepository = Remote

[Repository Local]
type = Maildir
localfolders = ~/mail
sep = .    

[Repository Remote]
type = IMAP
remotehost = imap.gmail.com
remoteuser = your_username@gmail.com
remotepass = your_gmail_password
ssl = yes
cert_fingerprint = bc9fb09aeb065316c9561d0d91c68ae822261601
maxconnections = 1
realdelete = no

14.2.2 notmuch

Install from git:

cd ~/emacs.d
git clone git://notmuchmail.org/git/notmuch
cd notmuch
sudo apt-get install libxapian-dev libgmime-2.4-dev libtalloc-dev
sudo make install
notmuch setup

Specify Maildir location as ~/mail.

notmuch new
notmuch tag +spam folder:spam
notmuch tag +sent folder:sent

14.3 Continued updates

Change appropriate line in ~/.notmuch-config:


New file ~/bin/notmuch-my-new:

notmuch new

notmuch tag +sent -new folder:sent and tag:new

notmuch tag +spam -new folder:spam and tag:new

notmuch tag +inbox -new tag:new
chmod +x ~/bin/notmuch-my-new

Now change the Gnubiff "When new mail, run command" to:

offlineimap && notmuch-my-new

14.4 Emacs

Download offlineimap.el into ~/.emacs.d.

Add to ~/.emacs:

(add-to-list 'load-path "~/.emacs.d")
(require 'offlineimap)
(require 'notmuch)

(setq mm-text-html-renderer nil) ;; html rendering is too slow
(setq notmuch-fcc-dirs nil) ; Gmail saves sent mails by itself

(define-key notmuch-show-mode-map (kbd "C-c C-o") 'goto-address-at-point)

(global-set-key (my-define-key-prefixer "g") (lambda ()
                                               (call-interactively 'notmuch)
                                               (search-forward "Search: ")))
(global-set-key (kbd "C-c c n") (lambda ()
                                  (notmuch-search "tag:inbox")))

(setq notmuch-saved-searches 
      '(("inbox" . "tag:inbox")
        ("week" . "date:1week..now")
        ("month" . "date:1month..now")))

(defvar my-notmuch-mail-path (expand-file-name "~/mail")
  "Location of local Maildir.")

Download nottoomuch-addresses into ~/bin.

Fetch addresses from mails:

./~/bin/nottoomuch-addresses --update

Should probably add as a cron job as well.

Add to ~/.emacs:

(require 'notmuch-address)
(setq notmuch-address-command "~/bin/nottoomuch-addresses.sh")

Adds TAB-completion in "To:" field when composing mails.

Date: 2014-06-16T20:24+0200

Author: Dan Amlund Thomsen

Org version 7.8.11 with Emacs version 24

Validate XHTML 1.0