Arch Linux on the HP Pavilion DM1-3xxx notebook (AMD E-350 “Zacate” based series)



Computer specs

Specs will vary, my model is the 3130.

Goal of this tutorial

To quickly setup a functional, lightweight Arch Linux system, optimized for our portable computer.
This guide may evolve during time as I try to improve my Linux experience🙂

Download Arch iso

(for the latest official release)

https://www.archlinux.org/download/

(or for the latest snapshot build)

http://releng.archlinux.org/isos/

Copy iso to USB pen drive (replace sdX with your drive, type fdisk -l to see drive list)
WARNING! WILL WIPE ALL DATA!
# dd if=archlinux-*.iso of=/dev/sdX bs=1M

Installation

Boot your HP DM1 with the USB pen drive

Update 2012/08/21

Arch installation has changed since the first version of this tutorial. Please refer to the official installation guide here :
then the post-installation guide :

Configuring our new system

Login as root.
We need to setup a network connection, let’s do it with the internal wireless adapter (reminder : the wifi chipset on this system is a Ralink RT5390 which is natively supported by the Linux kernel since version 3.0.1)
If you’re using a WPA protected access point like I do, you need to set up wpa_supplicant :
# cd /etc
# cp wpa_supplicant.conf wpa_supplicant.conf.backup
# nano wpa_supplicant.conf

I use the simplest network configuration :

network=(
  ssid="your_ssid"
  psk="your_passphrase"
)

(delete all other examples)

For security
# chmod 600 wpa_supplicant.conf
Up the wireless interface
# ip link set wlan0 up
Then start wpa_supplicant as a daemon, in the background
# wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
Get an IP address from your local dhcp server
# dhcpcd wlan0
NOTE : if you prefer to use the wired network interface, simply plug your cable and do
# ip link set eth0 up && dhcpcd eth0
If all is well, let’s update the whole system
# pacman -Syu
From now on, you might want to open a SSH session from another computer to copy and paste commands from this tutorial.
# pacman -S openssh

Start the openssh daemon :

# /etc/rc.d/sshd start
or
# rc.d start sshd
If you wan sshd to be started at boot :
# nano /etc/rc.conf

then append @sshd to the DAEMONS array (the ‘@’ prefix means that the daemon will be forked in the background)

Then login as root, on your notebook, from another system.
Configuring the soundcard
Let’s install the alsa utils
# pacman -S alsa-utils

Set up the sound mixer

# alsactl init; alsamixer
Use F6 to select the sound interface “HDA ATI SB”, adjust the volumes then ESC.
Don’t forget to save settings
# alsactl store
Add the alsa daemon in /etc/rc.conf
# nano /etc/rc.conf
DAEMONS=(syslog-ng network crond @sshd @alsa)
Now we need to tell the system to use the “HDA ATI SB” controller by default (and not the HDMI audio output)
# cat >/etc/modprobe.d/alsa.conf <<EOF
alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
options snd_hda_intel index=1
EOF
Be sure that our user (here the superuser) is in the ‘audio’ group!
# usermod -a -G audio root
(reboot for changes to take effect)
Finally, test basic sound output
# aplay /usr/share/sounds/alsa/Noise.wav
or
# speaker-test
If you like to test mp3 playback :
# pacman -S mpg123 && cd && wget http://storage.newjamendo.com/download/track/82293/mp32/Overture%20in%20Darkness.mp3 && mpg123 "Overture in Darkness.mp3"
Disable the painful speaker beeps!
# nano /etc/inputrc
Uncomment the line :
set bell-style none
Creating a regular user
# adduser
Additional groups : audio,video,optical,storage
Set default colors and font for virtual consoles
# nano /etc/profile
Append at the end of the file :
setterm -clear all -background black -foreground cyan -store
setfont Lat2-Terminus16
(the setting are applied only after the user logs in)

Installing X.Org

Still as root
# pacman -S xf86-input-evdev xf86-input-synaptics xf86-video-ati xorg-server xorg-xinit xterm ttf-liberation xorg-xsetroot xorg-xmodmap xorg-xinput
# startx
Should be working, except for the keymap (“setxkbmap <keymap>” can help!). And we have no window manager yet.
Installing a minimal, tiling window manager : dwm
# pacman -S dwm dmenu
Create our .xinitrc (adjust your keymap)
# cat >~/.xinitrc <<EOF
setxkbmap fr
xterm &
exec dwm
EOF
Start X again
# startx
We can play with some default keyboard shortcuts within dwm :
<Left SHIFT> + <Left ALT> + <RETURN> : open a new xterm
<Left SHIFT> + <Left ALT> + q : exit dwm (and X)
<Left ALT> + p : launch dmenu (dynamic menu)
# man dwm

for more!

Updated 04/21/2012

(Optional but recommended) Compile and install dwm (using ABS -the Arch Building System)

First, install ABS and the development environment, then run abs to download the abs files for dwm
# pacman -Sy abs base-devel && abs “community/dwm”

As a regular user, create a build directory in your home
$ mkdir -p $HOME/abs
then copy dwm’s build directory into it
$ cp -r /var/abs/community/dwm/ ~/abs
$ cd ~/abs/dwm

Get the source files
$ makepkg -o

Edit dwm’s config.h to your taste (French users have a look at http://wiki.archlinux.fr/DWM)
Also some nice color schemes here : http://fsk141.com/dwm-colors
$ nano config.h

Then compile and install with
$ makepkg -efi

Autologin into X

I choose not to use an X session manager (xdm, slim, gdm, …) but still want to start X automatically when I login from tty1.
For locking ttys, we need vlock
# pacman -S vlock
Edit .bash_profile startup script
$ nano ~/.bash_profile
add the following lines at the end of the file :
# automatically start X when login from tty1 (and lock the tty)
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
nohup startx >.xlog & vlock
fi
Security note : be sure to close all opened tty sessions when locking your computer🙂

Tweaking the touchpad

Right now, touchpad behaviour is quite strange, no regular right click button support, no scroller… Let’s try to improve that.
By default :
– a 1-finger tap will emulate the left mouse button (button number 1)
– a 2-finger tap will emulate the middle mouse button (scroller button) (button number 2)
– a 3-finger tap will emulate the right mouse button (button number 3)
Edit the configuration file for the touchpad under X
# nano /etc/X11/xorg.conf.d/10-synaptics.conf
add/modify the following options :
# used for the synclient command line
Option "SHMConfig" "on"
# for vertical scroll on the right edge of the touchpad
Option "VertEdgeScroll" "1"
# left mouse button
Option "TapButton1" "1"
# I prefer a 2-finger tap for the right mouse button
Option "TapButton3" "2"
# and a 3-finger tap for the middle mouse button
Option "TapButton2" "3"
# one tap in the right top corner of the touchpad will emulate a right mouse button
Option "RTCornerButton" "3"
Remember that you can tweak with the synclient command in an X terminal
# synclient -l
# synclient VertEdgeScroll=1
Don’t hesitate to experiment, and share your findings🙂

Special function keys

We have special function keys (using the “fn” dead key) like brightness up/down… which work out of the box.
And some other keys do nothing, like the “globe/internet” (fn+F5) key, or the volume up/down keys.
We can configure them using xev and xbindkeys :
# pacman -S xorg-xev xbindkeys
Now in an xterm, launch xev
$ xev

Now press the fn+F5 keys, xev reports KeyPress/KeyRelease events with keycode number 180.

Note : the “xbindkeys -k” command does the same thing and is easier to use!
Generate default configuration file for xbindkeys and add our program hotkey
$ xbindkeys --defaults > $HOME/.xbindkeysrc
$ nano $HOME/.xbindkeysrc
Add the following lines :
"firefox"
 c:180
Note : this keycode is also recognized by the X server as “XF86HomePage”
Then run the xbindkeys daemon (it will fork in the background automatically)
$ xbindkeys
Try your new hotkey, it works!
(Note : if using dwm, by default Firefox will open on the virtual screen number 9)
Remember to add xbindkeys to your .xinitrc.
Note : the “?” (fn+F1) key seems to send the same keycode as a simple F1…
Let’s configure the audio volume up/down/toggle keys while we are at it :
"amixer set Master 5-"
 XF86AudioLowerVolume
"amixer set Master 5+"
 XF86AudioRaiseVolume
"amixer set Master toggle"
 XF86AudioMute
Tip : Control+Shift+q shows all xbindkeys bindings
The “Menu” key
The Menu key on the right of the keyboard, is the one who emulates a right-mouse button click under Windows. We want the same here.
Unfortunately, the xmodmap method for binding the key to a mouse button :
$ xmodmap -e "keycode 135 = Pointer_Button3"

does not work.

Workaround with xte from the xautomation package.
# pacman -S xautomation
$ nano ~/.xbindkeysrc
add the following to your .xbindkeysrc :
"xte 'mouseclick 3'"
 Menu
Restart xbindkeys.
Note : solution is not 100% satisfactory, works more or less depending on the applications (works good in Firefox, not so much in an LXTerminal).
I have tested xdotool as well, same problems!
XScreensaver (power management)
# pacman -S xscreensaver
Then under an xterm, as a regular user, run
$ xscreensaver-demo

to configure it.

Be sure to add it to your .xinitrc
$ nano ~./xinitrc
add a line
xscreensaver -nosplash &
before the line launching your window manager.

Power Management

Since this is a notebook, power management has to be optimized.
CPU frequency
# pacman -S cpufrequtils
# cpufreq-info

tells us that there is no cpu frequency driver enabled

So we load the drivers’ modules
# modprobe powernow-k8 && modprobe cpufreq_ondemand && modprobe cpufreq_powersave
# cpufreq-info

much better!

Now for the settings to remain at boot time
Add the modules to the MODULES array in our /etc/rc.conf
MODULES=(powernow-k8 cpufreq_ondemand cpufreq_powersave)
and the cpufreq daemon in the DAEMONS array
DAEMONS=(syslog-ng network crond @sshd @alsa @cpufreq dbus)
Then edit cpufreq configuration
# nano /etc/conf.d/cpufreq
uncomment the line
governor=”ondemand”
Now reboot or start the cpufreq daemon manually
# rc.d start cpufreq
Install Laptop-mode-tools and other useful tools
# pacman -S laptop-mode-tools acpi acpid ethtool powertop upower
Note : you can check battery level anytime with
$ acpi

Configure laptop-mode

Main configuration file is /etc/laptop-mode/laptop-mode.conf
I did not change the defaults here.
Personalize LCD brightness levels
# nano /etc/laptop-mode/conf.d/lcd-brightness.conf
CONTROL_BRIGHTNESS=1
# lowest brightness when on battery
BATT_BRIGHTNESS_COMMAND=”echo 1″
# highest brightness when on AC power
LM_AC_BRIGHTNESS_COMMAND=”echo 10″
NOLM_AC_BRIGHTNESS_COMMAND=”echo 10″
BRIGHTNESS_OUTPUT=”/sys/class/backlight/acpi_video0/brightness”
Bluetooth management
# nano /etc/laptop-mode/conf.d/bluetooth.conf
I like to disable bluetooth when on battery (hell, I never use it anyway!)
# Control bluetooth?
CONTROL_BLUETOOTH=1
# Enable bluetooth on battery
BATT_ENABLE_BLUETOOTH=0
# Enable bluetooth on AC
AC_ENABLE_BLUETOOTH=1
# Bluetooth interfaces to enable/disable
BLUETOOTH_INTERFACES=”hci0″
Start laptop-mode daemon
# rc.d start laptop-mode
You can see if it works by unplugging/plugging the power cord and have a look at the logs (and your screen’s brightness of course!)
# tail /var/log/messages.log
Also useful
# laptop-mode status
Add laptop-mode daemon to the DAEMONS array
DAEMONS=(syslog-ng network crond @sshd @alsa @cpufreq @acpid @laptop-mode dbus)
Run powertop for useful advice
# powertop
IMPORTANT : disable wake-on-lan using ethtool, otherwise battery will be drained when computer is off! (WOL is enabled by default in the BIOS)
# nano /etc/rc.local.shutdown
add the lines :
ip link set eth0 up
ethtool -s eth0 wol d

Suspend to ram/suspend to disk (hibernate)

Install the pm-utils
# pacman -S pm-utils
Test suspend to RAM
# pm-suspend

It seems to work! Now press a key to wake up.

Put the computer in suspend mode (and lock the session) when closing the lid
Update 05/13/2012 : hibernate with Power Button.
This is handled by the acpid daemon
# nano /etc/acpi/handler.sh
    button/power)
echo “PowerButton pressed!”>/dev/tty5
case “$2” in
PBTN|PWRF)  logger “PowerButton pressed: $2”
xs=$(ps up $(pidof xscreensaver) | awk ‘/xscreensaver/ {print $1}’)
if test $xs; then su $xs -c “xscreensaver-command -lock”; fi
/usr/sbin/pm-hibernate
;;
*)          logger “ACPI action undefined: $2” ;;
esac
;;
….
    button/lid)
        case “$3” in
            close)
                #echo “LID closed!”>/dev/tty5
                # The lock command need to be run as the user who owns the xscreensaver process and not as root.
                # See: man xscreensaver-command. $xs will have the value of the user owning the process, if any.
                xs=$(ps up $(pidof xscreensaver) | awk ‘/xscreensaver/ {print $1}’)
                if test $xs; then su $xs -c “xscreensaver-command -lock”; fi
                  /usr/sbin/pm-suspend
                ;;
Test hibernation (suspend to disk)
We first need to set the resume partition in grub! (the swap partition is used, that’s why we chose a big swap partition size -equalling RAM size- when installing the system)
# blkid

then copy/paste the UUID for the swap partition, into the grub line

# nano /boot/grub/menu.lst
your kernel line should look something like this (UUIDs will be different of course)
kernel /vmlinuz-linux root=/dev/disk/by-uuid/c87172c8-52f5-4d0d-8c7a-6db9c571852f resume=/dev/disk/by-uuid/3fe7d979-f61d-42cc-9333-ef8de4a0ee10 ro
Next, we need to enable the “resume” hook in the initramfs, otherwise resuming will fail.
# nano /etc/mkinitcpio.conf
in the HOOKS array, add “resume” just before “filesystems”, like this :
HOOKS=”base udev autodetect pata scsi sata resume filesystems usbinput fsck”
TIP : set COMPRESSION to “lzop” for faster boot (you need to install the lzop package before issuing the mkinitcpio command)
Then regenerate the initramfs
# mkinitcpio -p linux
Now, try to hibernate
# pm-hibernate
Normally the computer will power down. Restart it.
Resuming should now work! If not, check the logs
# more /var/log/pm-*.log
This is a kind of victory for me here, since nearly all the distros I tried on this machine before (see here) could not hibernate/resume properly!

Allow regular users to use pm-suspend / pm-hibernate

Install and configure sudo
# pacman -S sudo && visudo
%wheel ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend 
%wheel ALL=(ALL) NOPASSWD: /usr/sbin/pm-hibernate
%wheel ALL=(ALL) NOPASSWD: /usr/sbin/pm-suspend-hybrid
Don’t forget to add your regular user account into the wheel group
# usermod -a -G wheel <username>
It’s easy to add a hotkey (in this example, Mod4 (the “Windows” key) + Escape) for hibernation, via xbindkeys
$ nano $HOME/.xbindkeysrc
"xscreensaver-command -lock; sudo /usr/sbin/pm-hibernate"
 Mod4 + Escape
Now that hibernation works flawlessly, I like to configure laptop-mode for automatic hibernation when battery level is critically low
# nano /etc/laptop-mode/conf.d/auto-hibernate.conf
Set ENABLE_AUTO_HIBERNATION=1
Restart laptop-mode
# rc.d restart laptop-mode
What about playing a nice beep song when this happens?
# pacman -S beep
# nano /usr/share/laptop-mode-tools/module-helpers/pm-hibernate
Add some beep commands like this :
# Freezer on preference
if [ x$MEM = x1 ]; then
        beep -r 3
        echo "mem" > /sys/power/state
elif [ x$DISK = x1 ]; then
        beep -r 5
        echo "disk" > /sys/power/state
else
        ## Nothing to do.
        echo ;
fi

Automatically suspend on idle/inactivity (under X.Org)

Add to your ~/.xinitrc :
xautolock -time 15 -locker "sudo pm-suspend-hybrid" &
(I find that pm-suspend-hybrid is convenient in this case)

Useful monitoring software

System utilities (htop, smartmontools)
# pacman -S htop smartmontools
Test hard drive health
# smartctl -H /dev/sda

Better network handling

with wicd
# pacman -S wicd
# rc.d restart dbus
# rc.d start wicd
Add wicd daemon to your rc.conf, after the dbus daemon.
To scan wireless networks and connect (as a regular user)
$ wicd-curses
Note : connection profiles are stored in /var/lib/wicd/configurations/

Firewall

Install the Uncomplicated firewall
# pacman -S ufw
If you are currently connected on your notebook via SSH, and to allow future incoming SSH connections
# ufw allow 22/tcp
then start the ufw daemon
# nano /etc/ufw/ufw.conf
Set ENABLED to yes, then start ufw
# rc.d start ufw
Check status
# ufw status
# iptables -L |more
Remember to add “ufw” to your DAEMONS array in /etc/rc.conf, just before the “network” daemon.

Let’s install some software for workstation usage

A better terminal emulator : lxterminal
# pacman -S lxterminal
Lightweight file manager : PCManFM
# pacman -S pcmanfm
Web browser : Mozilla Firefox (with some useful extensions, gracefully packaged by the Arch community)
# pacman -S firefox arch-firefox-search firefox-adblock-plus firefox-noscript
(You are able to watch HTML5 videos, on youtube and others, out of the box without any flash plugin)
TIP : disable disk cache to reduce disk spin-up and thus save battery. In Firefox, type “about:config” in the URL bar, then set browser.cache.disk.enable to false. (then type “about:cache” to verify).
Email client : Mozilla Thunderbird
# pacman -S thunderbird
(TIP: For better looking fonts, be sure to select Liberation-serif and Liberation-sans in all Mozilla applications)
Video players/recorders : MPlayer / MEncoder / ffmpeg and VLC
# pacman -S mplayer mencoder ffmpeg vlc
Test your webcam with mplayer
$ mplayer tv://

or

$ mplayer tv:// -tv driver=v4l2:width=320:height=240:fps=30
You even can capture video from webcam with mencoder
$ mencoder -tv driver=v4l2:width=640:height=480 tv:// -o webcam.avi -ovc lavc=mpeg4 -nosound

(here with no sound because mencoder complains about missing /dev/dsp sound device…)

ffmpeg is great for recording too (ideal for screencasts), here is an example for screen capture
$ ffmpeg -f x11grab -s 1366x768 -r 15 -i :0.0 -sameq capture.flv

(without sound)

$ ffmpeg -f alsa -i hw:0 -f x11grab -s 1366x768 -r 15 -i :0.0 -sameq capture.avi

(with sound, using the internal mic. Check your capture levels with alsamixer)

Note : webcam light stays on even after capture has finished. Know a fix anyone?
Audio player : Audacious
# pacman -S audacious audacious-plugins
Bind the special keys “rewind”, “forward”, “play/pause” on our keyboard with audacious
$ nano $HOME/.xbindkeysrc
Add the following :
“audacious -r”
 XF86AudioPrev
“audacious -f”
 XF86AudioNext
“audacious -t”
 XF86AudioPlay
Then restart xbindkeys
$ killall xbindkeys && xbindkeys
Neat feature, now even if Audacious is not launched, a simple hotkey will launch it and resume playing the current playlist🙂

Some small beautification tips!

Set desktop wallpaper with feh
# pacman -S feh
Go and download a super nice wallpaper at http://interfacelift.com/
(then as a regular user)
$ feh --bg-center <wallpaper filename>

will generate a ~/.fehbg

add the line to your xinitrc :
eval $(cat ~/.fehbg)
before the final “exec” line.
When you want to change the wallpaper, simply re-run
$ feh --bg-center <new wallpaper filename>
Change default GTK theme
# pacman -S gnome-themes-standard gnome-themes-extras lxappearance
$ lxappearance
Be sure to choose an icon theme too, for applications such as PCManFM to have correct icons.
TIP: Use a BIG mouse cursor in GTK apps!
$ echo >~/.gtkrc-2.0.mine "gtk-cursor-theme-size=48"
(be sure to have a .gtkrc-2.0 file – normally created by lxappearance – which includes your .mine file)
Updated 05/13/2012
This computer model comes with a glossy LCD screen (the biggest drawback on this computer). In order to improve user experience when using it in the sunlight, I have found that setting the desktop GTK theme to “HighContrast” can help. so I wrote a  small bash script which can be invoked with a hotkey (xbindkeys), which would switch the theme on and off.
We will need a small program from the AUR : gtkrc-reload ( http://aur.archlinux.org/packages.php?ID=44052 )
Download it and install it :
$ cd ~/AUR
$ tar xvzf gtkrc-reload*
$ cd gtkrc-reload && makepkg -i
Copy the gtk-switch-hicontrast.sh (look at the end of this tutorial) to your ~/bin directory (create it if needed). Don’t forget to :
$ chmod +x ~/bin/gtk-switch-hicontrast.sh
Now we can add the hotkey to switch from normal GTK 2.0 theme to HiContrast (here it will be Mod4 + h):
$ nano ~/.xbindkeysrc
“$HOME/bin/gtk-switch-hicontrast.sh”
Mod4 + h
As usual, save and restart xbindkeys.
Other tips to improve readability : set your terminals/virtual consoles  with high contrast colors.
Be sure to set the LCD backlight to the max (at the expense of the battery).

Conclusion

Arch Linux is a great distro for better understanding of how Linux systems work.
And remember, the Arch wiki is a goldmine🙂

Things To Do

  • mail alerts from smartmontools daemon if hard drive fails?
  • hibernation with the Power Button (not detected by acpid?)
  • automatically suspend when computer has been inactive for X minutes
  • install a launch panel?
  • re-install from scratch and use encrypted partitions!

Some simple custom scripts

battery.sh

#!/bin/bash
# battery.sh
batt_now=`cat /sys/class/power_supply/BAT0/energy_now`
batt_full=`cat /sys/class/power_supply/BAT0/energy_full`
batt_status=`cat /sys/class/power_supply/BAT0/status`
voltage_now=`cat /sys/class/power_supply/BAT0/voltage_now`
voltage_now_w=`echo "scale=2;$voltage_now / 1000000" | bc`
voltage_min_design=`cat /sys/class/power_supply/BAT0/voltage_min_design`
voltage_min_design_w=`echo "scale=2;$voltage_min_design / 1000000" | bc`
power_now=`cat /sys/class/power_supply/BAT0/power_now`
batt_level=`echo "scale=2;$batt_now/$batt_full*100" | bc`
conso=`echo "scale=2;$power_now / 1000000" | bc`

#echo "batt_full=$batt_full"
#echo "batt_now=$batt_now"
echo "Battery level : $batt_level % (status : $batt_status, $voltage_now_w V, min $voltage_min_design_w V)"
echo "System power consumption : $conso W"

wifi.sh

#!/bin/bash
# wifi.sh
killall dhcpcd
killall wpa_supplicant
wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf
dhcpcd wlan0

gtk-switch-hicontrast.sh

#!/bin/bash
#
# gtk-switch-hicontrast.sh
#
# switch current user's gtk 2.0 theme (to hicontrast and back)
#
# https://agentoss.wordpress.com / fredo696@gmail.com
#
# this script is best used when called with a hotkey
#
# useful for laptops with a glossy lcd panel!
# for best results set the backlight luminosity to the max.
# 
# dependencies (mandatory) : gnome-themes-standard (should include the hicontrast themes)
# dependencies (optional) : zenity, lxappearance,
# gtkrc-reload from the AUR ( http://aur.archlinux.org/packages.php?ID=44052 )
# 
# 
# Note : if you already have a .mine gtkrc file, please back it up
# before using this script because it will be overwritten!
# 
# be sure that your .gtkrc-2.0 has an include directive like :
# include "~/.gtkrc-2.0.mine" as the last line
#

# file for storing the actual switch value ("NORMAL" or "HI")
hifileswitch="$HOME/.hicontrast"

# gtkrc file to write changes to
gtkfile_mine="$HOME/.gtkrc-2.0.mine"

# check if file is readable or writable
touch $hifileswitch
if [ $? -ne 0 ];then
 echo "Error touching $hifileswitch, aborting!"
 exit 1
fi

# get current switch value
hivalue=`cat $hifileswitch`

if [ ! $hivalue == "HI" ];then
 zenity --info --text="Switching gtk theme to HiConstrast.nnPlease restart all running GTK apps for changes to take full effect" 
  --timeout=2
 echo "HI" >$hifileswitch
# populate .mine file with highcontrast values (customize yours here)
# here I choose a bigger font size and a bigger mouse cursor
 cat >$gtkfile_mine <<EOF
# generated by $0
# do not modify this file by hand, it will be overwritten!
gtk-theme-name="HighContrast"
gtk-icon-theme-name="HighContrast"
gtk-font-name="Sans 14"
#gtk-cursor-theme-name="Bluecurve"
gtk-cursor-theme-size=48
gtk-toolbar-style=GTK_TOOLBAR_BOTH
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintfull"
gtk-xft-rgba="rgb"
EOF

else
# switching back to normal theme
 zenity --info --text="Switching gtk theme to normal" --timeout=2

# customize your "normal" (ie. not high contrast) .mine file here
# here it is an empty file so that no values in the default gtkrc-2.0 file
# are overridden
 cat >$gtkfile_mine <<EOF
# generated by $0
# do not modify this file by hand, it will be overwritten!
EOF

 echo "NORMAL" >$hifileswitch
fi

# force gtk theme reload
# unfortunately, icons are not refreshed it seems
# so we need to restart manually all running gtk apps...
gtkrc-reload || lxappearance

exit 0

The Config files

/etc/rc.conf

#
# /etc/rc.conf - Main Configuration for Arch Linux
#
# See 'man 5 rc.conf' for more details
#
# LOCALIZATION
# ------------
HARDWARECLOCK="UTC"
TIMEZONE="Europe/Paris"
KEYMAP="fr"
CONSOLEFONT="Lat2-Terminus16"
CONSOLEMAP=
LOCALE="fr_FR.UTF-8"
DAEMON_LOCALE="yes"
USECOLOR="yes"
# HARDWARE
# --------
MODULES=(powernow-k8 cpufreq_ondemand cpufreq_powersave)
USEDMRAID="no"
USEBTRFS="no"
USELVM="no"
# NETWORKING
# ----------
HOSTNAME=dm1z
interface=
address=
netmask=
broadcast=
gateway=
NETWORK_PERSIST="no"
# DAEMONS
# -------
#
DAEMONS=(syslog-ng ufw network crond @sshd @alsa @cpufreq @acpid @laptop-mode dbus @wicd)

/etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1
network={
        ssid="your_ssid"
        psk="your_passphrase"
}

$HOME/.xinitrc

eval $(cat ~/.fehbg)
setxkbmap fr
xbindkeys
xscreensaver -nosplash &
xautolock -time 15 -locker "sudo pm-suspend-hybrid" &
#xterm &
#xterm -fg white -bg black -e htop &
while true; do xsetroot -name "`acpi | tr -d 'n'; echo -n " // "; date +%R; sleep 60`"; done &
exec dbus-launch dwm

$HOME/.xbindkeysrc

"xbindkeys_show"
  control+shift + q

"lxterminal"
 Mod4 + x

"firefox"
 c:180

"firefox"
 Mod4 + f

"thunderbird"
 Mod4 + t
"$HOME/bin/gtk-switch-hicontrast.sh"
 Mod4 + h 
"xscreensaver-command -lock; sudo /usr/sbin/pm-suspend"
 Mod4 + s

"xscreensaver-command -lock; sudo /usr/sbin/pm-hibernate"
 Mod4 + Escape

"audacious -r"
 XF86AudioPrev

"audacious -f"
 XF86AudioNext

"audacious -t"
 XF86AudioPlay

"amixer set Master 5-"
 XF86AudioLowerVolume

"amixer set Master 5+"
 XF86AudioRaiseVolume

"amixer set Master toggle"
 XF86AudioMute

"xte 'mouseclick 3'"
 Menu

Mandatory screenshot

6 thoughts on “Arch Linux on the HP Pavilion DM1-3xxx notebook (AMD E-350 “Zacate” based series)

  1. Wow. This article really showed me how much I have skipped (I only have pmutils for powersaving)

    😄 By the way, does bluetooth work for you? I never get anything with “hcitool scan”. I just finishes scanning without returning anything.

  2. “Disable the painful speaker beeps!”

    Oh man, I’m so fucking happier now. I almost cried after this trick worked.

    Thanks man, thanks… **a** **lot**!
    =D

  3. Pingback: Erratic sound on HP Pavilion dm1 netbook

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s