Debian Sid Desktop

Introduction
Debian Sid Desktop is a guide covering installing and configuring Debian Sid for desktop use. It came into existence originally as a dumping ground for things I had learnt or discovered about setting up a Debian Sid desktop, After a while I realised that others may find the information useful.

It is still currently a draft until I have time to tidy it up, items are added and removed as time goes by. Don't expect the documentation to be perfect!

Debian Sid is the unstable branch of Debian and can be considered a close counterpart of Arch Linux in that it is a "rolling release".

This document isn't for everyone and unless you have medium to advanced knowledge of Debian I would probably recommend against following this guide and instead use Ubuntu or another "hand holding" distribution. CrunchBang Linux is an excellent choice if you want the stability of Debian but want exposure to the command line and uses the excellent Openbox window manager. It has friendly forums with plenty of passionate Debian/Crunchbang users to help you.

You should update any HIGHLIGHTED TEXT with your configuration where necessary.

Install Media
debootstrap is used to install Sid. Most Debian based live CD's such as Ubuntu, Aptosid, Crunchbang etc. should work to bootstrap a Sid install. Ubuntu Desktop 12.04 was used for this guide. If your happy to use Ubuntu download the desktop version of Ubuntu 12.04 and create a bootable CD or USB drive.

Install Process
Boot to your live cd, configure an internet connection, open a terminal and su to to root however your live cd allows, e.g. on Ubuntu run:

sudo su

Prerequisites
It is assumed that you have created a standard user account and use vi as the default editor.

Preparation
Update and then install an editor, pager, ssh and gpm

apt-get update apt-get install --no-install-recommends ssh vim vim-doc vim-scripts \ vim-addon-manager less tcpd openssh-blacklist openssh-blacklist-extra

If you have another computer handy I would recommend connecting from the other computer via ssh and complete the next few tasks until you have a working desktop at which point you can complete it from the desktop there. Alternatively you could install a text based web browser such as lynx or links2 and copy and paste between consoles using gpm.

Hostname
Edit substituting the computers hostname where applicable.

127.0.0.1      localhost.localdomain   localhost 127.0.1.1      sidbox.example.local  sidbox ::1    ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
 * 1) The following lines are desirable for IPv6 capable hosts

Now run...

echo sidbox.example.local > /etc/hostname invoke-rc.d hostname.sh start

Afterwards check the hostname and fqdn are correct.

APT Configuration
The aptosid developers recommend apt-get only be used on Debian Sid, more information here.

Raphael Hertzog has a very good blog post about Debian package manager options and recommends aptitude on Debian Testing/unstable, the article can be found here.

aptitude and apt-get will keep track of each other (except for held packages) so you can use both, but you should choose one and stick to it. I use apt-get for software management and aptitude for various things such as the command.

Disable Recommends
I don't like recommended packages installing by default so I disable it.

cat > /etc/apt/apt.conf.d/10recommends <<EOF APT ""; APT::Install-Recommends "false"; EOF

The run update apt-get

apt-get update

You can also use the option in apt-get to avoid installing recommended packages.

Package Tidy Up
I don't use nano which is the default editor. Removing it should set vim as the default.

apt-get purge nano

Then run to review any packages no longer required.

apt-get autoremove --purge

Check what packages it wants to remove (if any) and investigate any packages using the following command or Google them.

apt-cache show package-name

Utilities
Now that you have a clean, minimal OS lets install some useful apt tools (and recommended packages), Google them or use if you want to know more.

apt-get install deborphan debfoster apt-file python-apt lsb-release file iso-codes dialog cruft apt-listbugs apt-rdepends reportbug

Then update apt-file

apt-file update

Firmware
Install the latest firmware packages to support your hardware. You are free to exclude any you don't need, I just install all of the available firmware.

apt-file update apt-get update apt-get install firmware-linux firmware-linux-nonfree apt-get install $(apt-file --package-only search /lib/firmware/ | tr '\n' ' ')

Otherwise install the firmware specific to your computer.

Software
Base software to install.

apt-get install bash-completion htop build-essential module-assistant linux-headers- amd64 psmisc \ tofrodos udisks upower udev consolekit policykit-1 dosfstools fakeroot hdparm ntfs-3g rsync mlocate \ libpam-ck-connector dkms sudo python dialog console-setup-linux bzip2 p7zip rar unrar unzip zip p7zip-full lzop lzip lzma \ ntp fontconfig pciutils lshw hwdata hwinfo syslinux dnsutils sshfs screen telnet bash-doc shared-mime-info lsof

Update your file name database from the locate package. You should run this command before using locate on occasion.

updatedb

Default Editor
Select vim.basic as the default editor assuming you use it.

As your standard user you can also export a variable in ~/.bashrc to set vim as the default.

export EDITOR=vim

Users bin folder
The default included with Debian looks for  and includes it in your path if it exists. This should be where you store any scripts or programs that you want for your standard user account.

su - username mkdir ~/bin

Bash dot files
Bash configuration I use

NTP
Configure ntp. further information on how to usage and configuration can be found here.

Edit and after the section  add some ntp servers.

server au.pool.ntp.org server ntp.cs.mu.oz.au

Then restart ntp and check it is connecting to the servers you specified.

invoke-rc.d ntp restart

{{hc|ntpq -p| remote          refid      st t when poll reach   delay   offset  jitter

=
================================================================= a.pool.ntp.uq.e 132.163.4.101   2 u    3   64    1   59.725  -755.40   0.004 203.171.85.237. .PPS. 1 u   2   64    1   53.822  -763.30   0.004 cachens2.onqnet 209.81.9.7      2 u    1   64    1   55.223  -764.30   0.004 tuppy.intrepidh 173.201.38.85   3 u    -   64    1  204.347  -761.36   0.004 lists2.luv.asn. .INIT. 16 u   -   64    0    0.000    0.000   0.000 web01-inovait.b .INIT. 16 u   -   64    0    0.000    0.000   0.004 }}

X Installation
To install a minimal X server and some desirable fonts run the following.

apt-get install xorg mesa-utils xbase-clients xsel dbus-x11 xfonts-terminus xfonts-terminus-dos \ xfonts-terminus-oblique ttf-mscorefonts-installer gsfonts-x11 ttf-dejavu ttf-liberation \ ttf-freefont ttf-droid libgl1-mesa-dri

fontconfig
If you want to change the font configuration such as autohinting, sub pixel rendering or enable bitmap fonts run the following:

dpkg-reconfigure fontconfig-config

Make your changes and then run:

dpkg-reconfigure fontconfig

Console Font
Change the console font as follows

dpkg-reconfigure console-setup

Select:

Asian Characters
by default, Asian characters are not displayed, if you desire them to be shown regardless of whether you understand any asian language you can do the following. The easiest and most lightweight solution for Chinese Simplified is adding one or both "WenQuanYi" sans serif fonts:

apt-get install ttf-wqy-zenhei ttf-wqy-microhei

Japanese has these and some more:

apt-get install ttf-vlgothic ttf-sazanami-mincho ttf-sazanami-gothic

can be used to search for more.

Korean can be added with

apt-get install ttf-unfonts-core

LCD Text Rendering
libxft2 in Debian does not use the lcdfilter option and therefore fonts (such as the Openbox menu) may look different when compared to GTK apps. This is how to fix that.

cd /usr/local/src

apt-get source libxft2 cd xft-2.2.0/src/ wget "http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/xft/precise/download/head:/100libxft2.1.10lcdfi-20091204214743-wmu4p0kkyg1zkrcr-4/100-libXft-2.1.10-lcd-filter-3.patch" patch -i 100-libXft-2.1.10-lcd-filter-3.patch cd ../ apt-get build-dep libxft2

Now edit and insert this at the beginning - update with your details etc.

xft (2.2.0-3-lcd) unstable; urgency=low * lcd filter patch. -- Foo Bar  Wed, 4 Jan 2012 21:28:11 +1100

Then build the package

dpkg-buildpackage -rfakeroot -uc -b

And install it and the dev package (to avoid any apt dependancy issues).

dpkg -i ../libxft2_2.2.0-3-lcd_amd64.deb ../libxft-dev_2.2.0-3-lcd_amd64.deb

See this link for the original information and some information about compilation errors you may experience if running i386.

Configuration
As your Standard user edit and add the following to it. Use the file as a template to configure font rendering as desired.

 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">  true  hintfull  rgb  true  lcddefault

More information can be found here

Configure Alsa
Install and setup alsa.

apt-get install alsa-base alsa-utils su - yourusername alsamixer

Set your volumes, then test and store them. I would recommend muting beep at this point so it saves when you run alsactl. beep is annoying...

aplay /usr/share/sounds/alsa/Front_Center.wav exit alsactl -f /var/lib/alsa/asound.state store

I get annoyed with the pc speaker beeps so I disable the module. Append the following to the file

blacklist pcspkr
 * 1) stop pcspkr from loading

OSS4 Alternative
I had a go at using OSS, you can read about it here.

Window Managers
A Window_Managers article covers installation and configuration of a number of Window Managers. Choose yourself and Window Manager, install it and come back and continue to the rest of this article.

Desktop Components
The following packages provide some useful libraries, utilities and engines.

apt-get install gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf \ gtk2-engines-aurora lxappearance librsvg2-common qt4-qtconfig \ desktop-base sux dmz-cursor-theme xdg-user-dirs xdg-utils hicolor-icon-theme \ libfile-mimeinfo-perl menu-l10n libgtk2.0-bin

Create your users standard home folders.

su - username xdg-user-dirs-update exit

Screen Resize and Rotate
arandr is a simple but flexible xrandr manager and I honestly think it does a better job than any other utility I have used.

apt-get install arandr

Panel
It's arguable that you even need a Panel but if desired tint2 is a good choice.

apt-get install tint2

To start when logging in to Openbox add the following line to your standard users

tint2 &

Wallpaper Setter
apt-get install nitrogen

Add the following to to have nitrogen restore your wallpaper on login.

nitrogen --restore &

Screenshots
apt-get install scrot

To take screenshot's of your desktop with keys PrtScn and ALT+PrtScn for the currently focused window like Microsoft Windows, you can do the following.

mkdir ~/Pictures/Screenshots

Add the following to the section of  replacing any existing configurations.

 scrot -z -e 'mv $f ~/Pictures/Screenshots/'  scrot -z -u -b -e 'mv $f ~/Pictures/Screenshots/'

Desktop Notifications
Twmn (tiling window manager notification) is a fairly new project that provides a minimalist notification system and works fine on Openbox. You can compile and install it as follows:

apt-get install git cd /usr/local/src git clone https://github.com/sboli/twmn.git cd twmn/ apt-get install qt4-qmake libqt4-dev libboost1.49-dev libdbus-1-dev libxext-dev \ libboost-program-options1.49-dev libboost-system1.49-dev qmake make make install

To start when logging in to Openbox add the following line to your standard users

twmnd &

You will then need to create a file with your desired settings, this thread on the Crunchbang forums has more information.

If you want more conventional desktop notications then do as follows, make sure you remove notification-daemon as it messes things up

apt-get autoremove --purge notification-daemon

apt-get install notify-osd libnotify-bin

You may like to to install notify-osd from the Crunchbang repo's as it allows for customisation. You will need to add the repository to your apt sources and then install it.

apt-get install -t statler notify-osd

You will will need to place it on hold if you decide to do this otherwise it will be upgraded. Pinning may also prove useful here...

cat > /etc/apt/preferences.d/notify-osd <<EOF Package: notify-osd Pin: release a=statler Pin-Priority: 800 EOF

Screen Locking
apt-get install gnome-screensaver

Clipboard
apt-get install clipit

This should start automatically by means of xdg autostart.

Xdefaults
wget -nc -O ~/.Xdefaults "http://www.bitbinary.com/dotfiles/X_.Xdefaults"

Language Input Methods
The preferred input method application is ibus, we get it with

apt-get install ibus ibus-gtk im-config

This doesn't bring much without the (keyboard) input method itself, this is depending on the language: Chinese pinyin input (most commonly used)

apt-get install ibus-pinyin

Anthy (Japanese)

apt-get install ibus-anthy

Hangul (korean)

apt-get install ibus-hangul

There are many other input methods for tables, they are too many to mention:

apt-cache search ibus-table

After installing, iBus will run as daemon and reside in the systray. We start it with ibus-daemon and configure it: - right-click the icon, choose Properties - in the tab labelled "Input Method" we select the input method(s) and click on "Add" to add them, one after the other. - after closing the window, we need to log out and back to make iBus work.

The daemon needs to be added to the ~/.config/openbox/autostart if not started automatically

ibus-daemon &

In the past, there was another input method called SCIM. It is still available, though its configuration is not as easy as iBus.

References: [http://crunchbanglinux.org/forums/post/166887/#p166887 Language Input by machinebacon on #! forums]

Networking
If using a workstation or computer or a machine with a static IP I would recommend using Debian's standard ifupdown or ceni.

Whilst using ceni is fine, if using a laptop network-manager can be convenient.

If desired install as follows:

usermod -a -G netdev youruser

cat > /etc/polkit-1/localauthority/50-local.d/10-org-freedesktop-network-manager-settings.pkla <<EOF [Allow members of netdev to create wireless connections for all users] Identity=unix-group:netdev Action=org.freedesktop.network-manager-settings.system.modify ResultAny=no ResultInactive=no ResultActive=yes EOF

Logout and login again. apt-get install network-manager-gnome modemmanager dnsmasq-base ppp mobile-broadband-provider-info gnome-bluetooth usb-modeswitch

vi /etc/NetworkManager/NetworkManager.conf

change managed=true in [ifupdown]

invoke-rc.d network-manager restart

check that interfaces in /etc/network/interfaces are commented out.

Add the following to openbox autostart.sh

(sleep 3 && nm-applet --sm-disable) &

To have networking start before the user is logged in ensure "available to all users" is selected in network-manager.

If using KDE4's plasma wigdet then read https://bugs.kde.org/show_bug.cgi?id=209464#c53

Power Management
Install the packages required for power management (exclude any you desire if using a desktop computer).

apt-get install pm-utils cpufrequtils wireless-tools ethtool vbetool

If you have a multi-processor or multi-cored CPU's on a laptop then irqbalance can be useful for power saving.

apt-get install irqbalance

Add info about scripts avaialble from source package of pm-utils

Terminal Emulator: rxvt-unicode
My preferred terminal emulator is rxvt-unicode

apt-get install rxvt-unicode

In order to set it as the default run the following command as root and choose the entry for /usr/bin/urxvt

update-alternatives --config x-terminal-emulator

I have the following in my ~/.Xdefaults

!## urxvt URxvt.visualBell:          false URxvt.depth:               32 URxvt.fading:              15% URxvt.fadeColor:           #0c0c0c URxvt.cursorBlink:         true URxvt.shading:             10 URxvt.geometry:            138x40 URxvt.transparent:         false URxvt.saveLines:           32767 URxvt.internalBorder:      5 URxvt.foreground:          #b8b8b8 URxvt.background:          [80]Black URxvt.font:                xft:liberation mono:pixelsize=11:antialias=true URxvt.boldFont:            xft:liberation mono::bold:pixelsize=11:antialias=true URxvt.scrollBar:           false URxvt.scrollTtyKeypress:   true URxvt.scrollWithBuffer:    false URxvt.scrollTtyOutput:     false URxvt.cutchars:            "*,<>[]{}|' URxvt.print-pipe:           cat > $(echo urxvt.dump.$(date +'%Y%M%d%H%m%S')) URxvt.secondaryScroll:      true URxvt.mapAlert:             true URxvt.utmpInhibit:          true URxvt.urlLauncher:          iceweasel URxvt.matcher.button:       1 URxvt.perl-ext-common:      default,matcher !## urxvt colors !black URxvt*color0:               #171717 URxvt*color8:               #737373 !red URxvt*color1:               #FF5E5E URxvt*color9:               #FF7878 !green URxvt*color2:               #9CE82B URxvt*color10:              #9ACD32 !yellow URxvt*color3:               #F0E68C URxvt*color11:              #EEE8AA !blue URxvt*color4:               #008AFF URxvt*color12:              #4F98FF !magenta URxvt*color5:               #E88CFF Rxvt*color13:               #EDA6FF !cyan URxvt*color6:               #87CEFA URxvt*color14:              #B0E2FF !white URxvt*color7:              #DCDCCC URxvt*color15:             #FFFFFF

Clipboard
urxvt does not copy data to the primary selection which can a problem in certain situations, so I use a perl script created by Bert Muennich to make things feel more intuitive.

This clipboard does not automatically copy selections in urxvt, if you would like primary selections automatically copied to the clipboard then set URxvt.clipboard.autocopy: true in ~/.Xdefaults. It also has a convenient method to paste inserting escapes where necessary.

mkdir -p ~/.urxvt/perl wget -O ~/.urxvt/perl/clipboard "https://raw.github.com/muennich/urxvt-perls/master/clipboard"

As your normal user insert the following in ~/.Xdefaults (replace "youruser" with your user name).

URxvt.perl-lib:            /home/youruser/.urxvt/perl/ URxvt.perl-ext:            clipboard URxvt.keysym.C-Insert:     perl:clipboard:copy URxvt.keysym.S-Insert:     perl:clipboard:paste URxvt.keysym.S-A-Insert:   perl:clipboard:paste_escaped URxvt.clipboard.autocopy:  true

Then retrain yourself away from the Microsoft Windows method of using CTRL-c, CTRL-x and CTRL-v and use:
 * CTRL + Insert = Copy
 * SHIFT + Delete = Cut
 * SHIFT + Insert = Paste
 * (SHIFT + ALT + Insert = Paste with escapes into urxvt)

https://github.com/muennich/urxvt-perls

Alternatives
| Terminator

| mrxvt

|xterm

Run Command
apt-get install gmrun

cp /usr/share/gmrun/gmrunrc > ~/.gmrunrc sed -i 's/Terminal = x-terminal-emulator/Terminal = eval x-terminal-emulator/' ~/.gmrunrc

Further information about the use of eval here

File Management
After trying just about all the different file managers I found Nautilus to be my favourite, use your preferred one if desired.

Install base file management components which is basically a file manager, disk burner and image viewer

apt-get install nautilus policykit-1-gnome gvfs-backends gnome-keyring gvfs-bin gvfs gvfs-fuse nautilus-open-terminal \ libpam-gnome-keyring gconf-editor gnome-session-common gnome-user-guide yelp nautilus-actions nautilus-image-converter

CD/DVD Management
apt-get install brasero genisoimage cdrdao cdrskin xorriso

Image Viewer
Gthumb

apt-get install gthumb

Then enable any extensions you desire in the interface

Add the following lines to the end of /etc/pam.d/login to unlock the keyring when you login through tty. gnome-keyring-daemon should start automatically.

auth           optional        pam_gnome_keyring.so session         optional        pam_gnome_keyring.so  auto_start

Reboot after adding them.

Add user to fuse group (mainly for gvfs although this may no longer be required... seems to work now even if I was not a member of the fuse group)

usermod -a -G fuse youruser

Configure Nautilus to stop hijacking the desktop

su - youruser gconftool-2 -s -t bool /apps/nautilus/preferences/show_desktop false gconftool-2 -s -t bool /desktop/gnome/background/draw_background false exit

File Associations
The package gnome-session-common provides us with our defaults.list application file which can be used to set default applications. In order to utilise them you should do something similar to this.

Note: I found that having the file .local/share/applications/mimeapps.list caused xdg-open to fail to adhere to my associations. I moved it to .local/share/applications/defaults.list and edited that instead.

mv ~/.local/share/applications/mimeapps.list ~/.local/share/applications/defaults.list

As and example I ran the following to setup my default image viewer options.

If your defaults.list did not previously exist run this command.

echo "[Default Applications]" > ~/.local/share/applications/defaults.list grep image /usr/share/gnome/applications/defaults.list | sed 's/eog.desktop/viewnior.desktop/' >> ~/.local/share/applications/defaults.list

Make sure after editing the file as above that you move the "[Added Associations]" if it exists below the redirected list created from the above comamnd... e.g.

... image/x-pict=totem.desktop [Added Associations] ...

Setup sharing via samba to windows clients
As root do the following.

apt-get install nautilus-share samba Answer any debconf questions... cp /etc/samba/smb.conf /etc/samba/smb.conf.default vi /etc/samba/smb.conf

add the following to the global section

map to guest = bad user usershare allow guests = yes

Add your user as a smb user

smbpasswd -a youruser usermod -a -G sambashare youruser

Restart Samba

invoke-rc.d samba restart

You should

Miscellaneous Apps
apt-get install gcalctool remmina remmina-plugin-rdp remmina-plugin-vnc smbclient cifs-utils conky transmission

Web Browser
apt-get install iceweasel flashplugin-nonfree default-jre icedtea-plugin aspell-en \ myspell-en-au

If you like Chromium then install that instead of or as well as Iceweasel.

Google talk plugin
Now that MS owns Skype and support for Skype was never that great anyway google talk is a good option, presuming you have a Google account.

wget -O /etc/apt/sources.list.d/google-talkplugin.list "http://www.bitbinary.com/dotfiles/apt_source_google-talkplugin.list" wget -O /tmp/apt_google-key.asc "http://www.bitbinary.com/dotfiles/apt_google-key.txt" && apt-key add /tmp/apt_google-key.asc apt-get update apt-get install google-talkplugin

Text and Documents
apt-get install evince abiword gnumeric

Optionals: if you want a gui version of vim or openoffice

apt-get install vim-gtk vim-doc

To be able to view windows world docuements you can install. apt-get install openoffice.org-impress openoffice.org-calc openoffice.org-writer openoffice.org-gtk \ openoffice.org-l10n-en-gb openoffice.org-help-en-gb

Other options are gnumeric and abiword if you want something lighter.

Or just use google docs, I believe openoffice has support for google docs sync now also.

Python Docs
apt-get install diveintopython3 python3-doc python3-examples

Located at

file:///usr/share/doc/diveintopython3/html/index.html file:///usr/share/doc/python3.2/html/index.html

Media and Music
apt-get install vlc vlc-plugin-notify libmtp-runtime

Graphics
apt-get installgimp gimp-help-en videolan-doc gimp-data-extras inkscape imagemagick thewidgetfactory

Virtualbox
apt-get install virtualbox virtualbox-dkms virtualbox-source virtualbox-qt libqt4-opengl virtualbox-guest-additions-iso

Add info about skype

Wine (Play on Linux)
apt-get install playonlinux smbclient samba-common-bin ttf-liberation

Laptop Packages
Seriously.... power management on Linux WTF is going on... I just spent a few hours trying to understand what packages I did and didn't need, ended up removing acpi-support, acpid, acpi-support-base, acpi-fakey, hibernate. For my Lenovo R500 I also had to this to get some media keys such as mute working.

vi /etc/default/grub

Added "acpi_osi=Linux" to the boot arguments

GRUB_CMDLINE_LINUX_DEFAULT="quiet acpi_osi=Linux"

Then

update-grub

If running a laptop install these

apt-get install vbetool bluez python-dbus ceni cpufrequtils pm-utils wireless-tools iw hdparm \ sdparm ethtool powertop rfkill lm-sensors smartmontools ibam

If you need to manage your wireless vs wired then install apt-get install ifplugd ifmetric perhaps use either laptop-mode-tools or xfce4-power-manager

apt-get install gnome-power-manager

Fix for resume on LVM - This bug is now resolved but you should be aware of this if you ever rename your volume groups. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=568877 echo "RESUME=/dev/mapper/vg00-swap" > /etc/initramfs-tools/conf.d/resume update-initramfs -u

(The following is only really useful if you do not use network manager) Add the following to restart wireless after suspend/hibernate.

vi /etc/pm/sleep.d/45wlan.sh

case "$1" in   hibernate|suspend)        ifdown wlan0    ;;      thaw|resume) ifup wlan0 ;;     *)      ;; esac

exit $?

chmod +x /etc/pm/sleep.d/45wlan.sh

Xgamma can be used alter the RGB values

detect other modules to load

sensors-detect

As per bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618878. power saving for wireless does not work from pm-utils on recent Debian Kernels. until a proper fix is made I just commented out line 21 in /usr/lib/pm-utils/power.d/wireless


 * 1) [ -d "/sys/class/net/$1/wireless" ] || return 1

I also enable sata link power management On line 5 in /usr/lib/pm-utils/power.d/sata_alpm update the value from false to true SATA_ALPM_ENABLE=${SATA_ALPM_ENABLE:-true}

I then added this script with some customisations:

modlist="uvcvideo" buslist="pci spi i2c" case "$1" in   true)    # Enable some power saving settings while on battery       # Intel power saving        echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller       # USB powersaving        for i in /sys/bus/usb/devices/*/power/autosuspend; do            echo 1 > $i        done       # Disable hardware modules to save power        for mod in $modlist; do            grep $mod /proc/modules >/dev/null || continue            modprobe -r $mod 2>/dev/null        done       # Enable runtime power management. Suggested by powertop.        for bus in $buslist; do            for i in /sys/bus/$bus/devices/*/power/control; do                echo auto > $i            done        done        echo 0 > /proc/sys/kernel/nmi_watchdog        echo 0 > /sys/devices/platform/thinkpad_acpi/bluetooth_enable    ;;    false) #Return settings to default on AC power echo N > /sys/module/snd_hda_intel/parameters/power_save_controller for i in /sys/bus/usb/devices/*/power/autosuspend; do           echo 2 > $i done for mod in $modlist; do           if ! lsmod | grep $mod; then modprobe $mod 2>/dev/null fi       done for bus in $buslist; do           for i in /sys/bus/$bus/devices/*/power/control; do                echo on > $i done done echo 1 > /proc/sys/kernel/nmi_watchdog echo 1 > /sys/devices/platform/thinkpad_acpi/bluetooth_enable ;; esac exit 0
 * 1) !/bin/sh
 * 2) A script to enable laptop power saving features for #! & Debian GNU+linux.
 * 3) http://crunchbanglinux.org/forums/topic/11954
 * 1) List of modules to unload, space seperated. Edit depending on your hardware and preferences.
 * 1) Bus list for runtime pm. Probably shouldn't touch this.

I use a thinkpad r500 and use thinkfan for more savings plus quiet operation:

apt-get install thinkfan

/etc/default/thinkfan Change start to yes

add the following to this file /etc/modprobe.d/thinkpad_acpi.conf

options thinkpad_acpi fan_control=1

reboot

sensors && cat /proc/acpi/ibm/thermal && smartctl -A -d ata /dev/sda | grep Temperature

read the config file in /etc/thinkfan.conf and if possible identify you laptops sensors.

My sensors line from my R500 looks like this.

sensor /proc/acpi/ibm/thermal (2, 0, 0, 0, 5, 0, 5, 0, 10, 2, 2, 0, 0, 0, 0, 0)

Bluetooth Keyboard and Mouse
apt-get install bluez bluetooth bluez-firmware

Check your bluetooth adapter is available

hcitool dev

Scan for bluetooth devices and note their addresses

hcitool scan

Initiate connection

bluez-simple-agent hci0 00:00:00:00:00:00

Trust the device

bluez-test-device trusted 00:07:61:37:D5:60 yet

Test connection or reboot to see if device connects once the bluetooth daemon starts.

bluez-test-input connect 00:07:61:37:D5:60

QT Theming
Run qtconfig and select GUI Style to GTK+ so KDE/QT apps look the same.

Clear the screen after boot.

cp /etc/issue /etc/issue.old clear > /etc/issue cat /etc/issue.old >> /etc/issue

Improve Boot Visuals
By Default the Debian boot sequence is a little dull. Sure you can add things like usplash but I would rather stick with the console output instead of using packages to "make things purdy".

First I install the Terminus Font and reconfigure the console-setup package to make use of it.

Ensure the packages are installed and then reconfigure console-setup

apt-get install console-terminus console-setup kbd dpkg-reconfigure console-setup

Answer the debconf questions, the first 2 are typically default.

Encoding to use on the console: (hit Enter) Character set to support: (hit Enter) Font for the console: Terminus Font size: 12x6 (or choose your desired size)

Your console font should now be using Terminus at the desired size. Reboot to see the new font upon boot.

Make it Quiet
Adding "quiet" to grub's arguments will mean less information is spewed onto the console at bootup. This is important to making the boot bootiful :)

vi /etc/default/grub

Find the following line and edit it as follows

GRUB_CMDLINE_LINUX_DEFAULT="quiet"

Save and exit the file, then update grub

update-grub

You can reboot again if you would like to see the result.

Update initrd with graphics drivers
Upon boot you may have noticed the font changes halfway through the boot sequence which looks a little odd. So lets fix that.

Firstly we need to get our graphics card module loaded as soon as possible at boot by loading it into initrd. initramfs-tools should be installed already unless you have a unusual install.

For The Intel graphics on my Lenovo R61 laptop I did:

echo i915 >> /etc/initramfs-tools/modules

For The ATI Radeon card in my Desktop I did:

echo radeon >> /etc/initramfs-tools/modules

Plus you need to ensure the "firmware-linux-nonfree" package is installed for the radeon firmware.

You will need to google other graphics cards modules and I have no idea how or if this works with proprietary drivers. I don't use them so don't bother asking.

With the Radeon I also had to turn on kernel mode setting by parsing it from grub (The Intel used it by default), This may have changed by the time you read this and might not be required. Try with without first of all.

vi /etc/default/grub Find the following line and edit it as follows

GRUB_CMDLINE_LINUX_DEFAULT="quiet radeon.modeset=1"

Save and exit the file, then update grub

update-grub

Once done, regenerate your initrd by running:

update-initramfs -u -v

Loading Fonts into initrd
So the Boot sequence is a seemless as possible we need to load the fonts into the initrd

wget -O /usr/share/initramfs-tools/hooks/console_setup "http://www.bitbinary.com/dotfiles/initramfs_hooks_console-setup" wget -O /usr/share/initramfs-tools/scripts/init-top/console_setup "http://www.bitbinary.com/dotfiles/initramfs_scripts_console-setup" chmod +x /usr/share/initramfs-tools/hooks/console_setup chmod +x /usr/share/initramfs-tools/scripts/init-top/console_setup

Then regenerate your initrd:

update-initramfs -u -v

You should notice the hook for console_setup being run (as long as you used the -v argument). Again... if you want to see the result... reboot.

LSB Logging
Debian supports the Linux Standard Base Logging Script for most services init runs. To make these console messages bootiful create the following file:

wget -O /etc/lsb-base-logging.sh "http://www.bitbinary.com/dotfiles/lsb_lsb-base-logging.sh.txt"

Lastly reboot to see the effect.

OpenBox menus
sudo updatedb sudo apt-file update

Upload bash dot files

Preconfigured Desktop
If you would like to use a config I have made up to give you a nice basic desktop, then do the following. WARNING this overwrites existing files.

cd wget -O xfiles.tar.gz "https://docs.google.com/a/mesrobertson.com/uc?id=0B2vLcjUrgXL-NmIwYTYyY2QtOGU2MS00NTI2LWI4YzgtZWQ4NjNjNGViN2Ey&export=download&hl=en_GB" tar --no-same-permissions --no-same-owner -xvzf xfiles.tar.gz rm xfiles.tar.gz

There is a bug with consolekit at the time of writing so if you cannot mount disks, reboot, shutdown etc. then install this (older) version of consolekit and place consolekit on hold.

cd /var/cache/apt/archives/ wget "http://ftp.us.debian.org/debian/pool/main/c/consolekit/consolekit_0.4.1-4_i386.deb" dpkg -i consolekit_0.4.1-4_i386.deb echo "consolekit hold" | dpkg --set-selections

If you have an ntfs volume you want to easily access via nautuilus from your normal user (perhaps a multiboot partition) do the following.

vi /usr/share/polkit-1/actions/org.freedesktop.udisks.policy

Edit the section  Change auth_admin_keep to yes

Reboot for it to take affect.

At this point if you wish you can start using your GUI. Simply reboot and then login to the first console as you normal user and startx will be invoked if you have used my bash config files.