Monday, January 18, 2010

How to setup Arch Linux w/ OpenBox


  1. Boot CD & type /arch/setup
  2. Source: core-local (only if you have the core iso, else core-remote) note: core-remote works with both versions of the ISO. You'll end up with the latest packages installed.
  3. Pick nano as your editor unless you know vi :P
  4. Clock: UTC (localtime if you have a windoze partition)
  5. Auto Prepare HDD (if you plan to use entire disk)
  6. Select grub as your bootloader (it's pretty robust)
  7. Select base, sudo (netcfg & wireless_tools if you use wireless :D) & install them. (type pacman -S base-devel if later you want the extras)
  8. Configure system
    -rc.conf
    -check timezone
    -change myhost to your desired cpu name (ex: sasoria) 
    -/etc/modprobe.d/modprobe.conf: add the following lines to disable beep
    blacklist snd_pcsp
    blacklist pcspkr

    -/etc/hosts: be sure to see your hostname
    -/etc/locale.gen: uncomment your locale
    -/etc/pacman.d/mirrorlist: uncomment for your country & some extra close mirrors (e.g., Canada & US in case a mirror is down :D)
    -Set your root passwd & click Done
  9. Install Bootloader (check menu.lst & see if all cool) & select your main HD & Reboot
  10. Login as root & ping www.google.com to check your network (for wifi network here's what to do: # ifcfg wlan0 up,# iwlist wlan0 scan,# iwconfig wlan0 essid "MyEssid" key s:asciikey, # dhcpcd wlan0)
  11. pacman -Syu & reboot if there was a kernel upgrade
  12. useradd -m -G users,audio,video,wheel,storage,optical,power,network,log -s /bin/bash yourusername (add "lp" to the options if you use a printer)
  13. passwd yourusername
  14. pacman -S alsa-firmware alsa-utils alsa-oss

    -alsaconf (detect snd card)
    -run alsamixer as normal user (su - yourusername) to adjust vol(m to unmute)
    -save settings by going back root & run alsactl store

  15. type nano /etc/rc.conf to add dbus & alsa: DAEMONS=(dbus ... @alsa)
  16. pacman -S xorg-server xorg-xinit xorg-utils xorg-server-utils & pacman -S xf86-video-your_video_card (note: to know your video chipset type: lspci | grep VGA)
  17. type nvidia-xconfig (if you have a nvidia card), else
    Xorg -configure & # cp /root/xorg.conf.new /etc/X11/xorg.conf
    (note: xorg.conf is optional so if you do not use it, grab arandr to change resolution or you can use a proprietary utility such
    as nvidia-utils for nvidia cards)
  18. pacman -S openbox obconf obmenu lxappearance consolekit
  19. Once openbox is installed, move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:
    # su - yourusername
    $ mkdir -p ~/.config/openbox/
    $ cp /etc/xdg/openbox/rc.xml ~/.config/openbox
    $ cp /etc/xdg/openbox/menu.xml ~/.config/openbox
  20. edit your ~/.xinitrc and add the following:
    exec ck-launch-session dbus-launch openbox-session
  21. YOU'RE DONE. Reboot, login with your user & type startx to access your empty desktop and customize your archbox to your tastes
Now some useful things to get:
-A network manager
-If you want to autologin
or a login manager
-Install common codecs:
pacman -S gstreamer0.10-plugins
-Install flash: pacman -S flashplugin
-Install java: pacman -S jre
-Install a browser: pacman -S chromium (grab jumanji-git from the AUR if you're minimalist & don't need java!)
-A file manager: pacman -S pcmanfm
-Install a text editor: pacman -S leafpad (get geany too if you write programs)

-NTFS write support:
pacman -S ntfs-3g ntfsprogs
-An archive program: pacman -S xarchiver p7zip zip unzip unrar
-A disk partitioner: pacman -S gparted (or gnome-disk-utility)
-Media swiss knife: pacman -S gnome-mplayer vlc (& deadbeef in the AUR)
-Conky: pacman -S conky
-A taskbar: pacman -S tint2 (or adeskbar in the AUR)
-A wallpaper manager: pacman -S nitrogen
-An image viewer: pacman -S geeqie
-A screenshot utility: pacman -S scrot
-A volume manager: pacman -S volwheel (or volumeicon in the AUR). note:alsa has a CLI mixer already "alsamixer"
-A cd burner: pacman -S xfburn (or graveman in the AUR)

-A pdf viewer: pacman -S zathura
-A drop down terminal: pacman -S tilda
-A run dialog box: pacman -S gmrun

-Microsoft Office's equivalent: pacman -S libreoffice
-Install e-mail manager: pacman -S alpine (or thunderbird)
-For your sticky notes needs: pacman -S xpad
-A calculator: pacman -S xorg-xcalc (or galculator in the AUR)
-install html editor: pacman -S bluefish
-Install a p2p application: pacman -S frostwire
-Install a torrent manager: pacman -S transmission-gtk
-Install a network traffic listener: pacman -S wireshark tcpflow
-Install an HEX editor: pacman -S ghex
-A
dynamic menu launcher: pacman -S dmenu (or dmenu-xft in the AUR)
-A chat client: pacman -S pidgin
-A photoshop-like program: pacman -S gimp
-An ftp client: pacman -S gftp
-A network tool: pacman -S gnome-nettool
-A dvd ripper: pacman -S k9copy (or handbrake)

-To put a video on CD/DVD: pacman -S devede
-An audio cd extractor: pacman -S sound-juicer
-A sound converter: pacman -S soundconverter
-A scanner utility: pacman -S xsane
-A chm viewer
: pacman -S xchm
-A WYSIWYG editor: pacman -S seamonkey (launch w/ "seamonkey --edit")
-For video conference: pacman -S skype
-VirtualBox PUEL

-maybe a windows program loader lol: pacman -S wine (only if your architecture is i686, click here for 64 bit version)

Here's some tips to setup OpenBox
1) obmenu is a your best friend if you want a GUI to edit the menu. Open in a terminal obmenu and create a shortcut to obmenu itself :D. Now that you have a GUI to edit the menu, the rest is pretty straightforward. Create sub-menus and items to the categories you desire and to your applications. For a complete guide on openbox, check urukrama's guide. One of the most complete ones for OpenBox. You could also check the wiki about it :D
2) create an empty file called autostart in ~/.config/openbox in which you'll autostart the applications you need to have a nice desktop. Here's my autostart for example:

#to restore the last wallpaper used in nitrogen
nitrogen --restore &
#your taskbar
tint2 &
#Thunar's file manager
thunar --daemon &
#conky system monitor
conky -q &
3) OpenBox is pretty light and needs extra applications to do the rest of the job. Like you saw in step 2, there's some applications you'll have to autostart to have a comfortable working environment but you could use other alternatives.
  • Besides nitrogen to handle wallpaper, feh is pretty good!
  • I personally prefer Thunar over PCManFM
  • tint2 is nice but another good alternative would be pypanel
  • Conky system monitor is so versatile and so lightweight since it's text-based but it's optional to use it
4) It's a good idea to create a menu item to obconf to change your OpenBox theme and settings. note: put your saved themes in ~/.themes/5) Another good menu item would be one to open lxappearance to change your window theme & icons. note: put your saved themes in ~/.themes/ and your saved icons packs in ~/.icons/
    6) Here's my conky configuration in case you use it:
    background yes
    use_xft yes
    xftfont Sans:size=8
    xftalpha 1
    update_interval 1.0
    total_run_times 0
    own_window yes
    own_window_transparent yes
    own_window_type desktop
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
    double_buffer yes
    minimum_size 200 200
    maximum_width 200
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders yes
    default_color white
    default_shade_color blue
    default_outline_color white
    alignment top_right
    gap_x 12
    gap_y 12
    no_buffers yes
    uppercase no
    cpu_avg_samples 2
    override_utf8_locale no

    TEXT
    ${font sans-serif:bold:size=8}SYSTEM ${hr 2}
    ${font sans-serif:normal:size=8}$sysname $kernel $alignr $machine
    Host:$alignr$nodename
    Uptime:$alignr$uptime
    File System: $alignr${fs_type}
    Mail: $alignr ${execi 300 python ~/.scripts/gmail.py}

    ${font sans-serif:bold:size=8}AMD Turion(tm) 64 X2 TL-60${hr 2}
    ${font sans-serif:normal:size=8}${cpugraph cpu1}
    Core 1: ${cpu cpu1}% ${cpubar cpu1}
    ${font sans-serif:normal:size=8}${cpugraph cpu2}
    Core 2: ${cpu cpu2}% ${cpubar cpu2}

    ${font sans-serif:bold:size=8}MEMORY ${hr 2}
    ${font sans-serif:normal:size=8}RAM $alignc $mem / $memmax $alignr $memperc%
    $membar

    ${font sans-serif:bold:size=8}HDD ${hr 2}
    ${font sans-serif:normal:size=8}/ $alignc ${fs_used /} / ${fs_size /} $alignr ${fs_used_perc /}%
    ${fs_bar /}
    ${font sans-serif:normal:size=8}/home $alignc ${fs_used /home} / ${fs_size /home} $alignr ${fs_used_perc /home}%
    ${fs_bar /home}

    ${font sans-serif:bold:size=8}TOP PROCESSES ${hr 2}
    ${font sans-serif:normal:size=8}${top_mem name 1}${alignr}${top mem 1} %
    ${top_mem name 2}${alignr}${top mem 2} %
    $font${top_mem name 3}${alignr}${top mem 3} %
    $font${top_mem name 4}${alignr}${top mem 4} %

    ${font sans-serif:bold:size=8}NETWORK ${hr 2}
    ${font sans-serif:normal:size=8}IP address: $alignr ${addr wlan0}
    ESSID: $alignr ${wireless_essid wlan0}
    Connection quality: $alignr ${wireless_link_qual_perc wlan0}%
    ${downspeedgraph wlan0}
    DLS:${downspeed wlan0} kb/s $alignr total: ${totaldown wlan0}
    ${upspeedgraph wlan0}
    ULS:${upspeed wlan0} kb/s $alignr total: ${totalup wlan0}

    ${font sans-serif:bold:size=8}SHORTCUT KEYS ${hr 2}
    ${font sans-serif:normal:size=8}Super+t$alignr Terminal
    Super+f$alignr File Manager
    Super+e$alignr Editor
    Super+w$alignr Web Browser
    Super+q$alignr Force Quit
    Super+v$alignr Adjust Volume
    Super+u$alignr System Upgrade
    7) If you use nitrogen as your wallpaper manager, don't forget to add in preferences the directory where your wallpapers are located.

      8) What would be OpenBox without keybindings! You can add/edit keybindings in rc.xml file placed in ~/.config/openbox/. You can get obkey from the AUR if you want a GUI for that. Here's a keybind example (my favorite one lol):

      note:replace terminator with your favorite terminal (ex: roxterm, xterm, yakuake)

      9) Packer is the best tool out there to get AUR packages. Here's 4 simple steps to install it:
      1. pacman -S base-devel (if not already done)
      2. get the PKGBUILD
      3. run makepkg where you saved PKGBUILD
      4. pacman -U packer-*.pkg.tar.xz AND YOU'RE DONE!
      packer -S ThePackageYouWant (whether it's from the main reps or the AUR)!

      19 comments:

      1. This comment has been removed by the author.

        ReplyDelete
      2. This how-to is awesome. After trying to set up Arch unsuccessfully for weeks, this guide had me up and running in no time. Thanks and major geek creds to the author.

        ReplyDelete
      3. This comment has been removed by the author.

        ReplyDelete
      4. Whilst I commend your outstanding effort to port OpenBox onto Arch I think you missed the point of why CrunchBang is not called Ubuntu-Bang!

        CrunchBang (#!) being based on Ubuntu && in turn Ubuntu being itself based on Debian.

        CrunchBang takes it's name from the Shebang. In computing, a shebang (also called a hashbang, hashpling, pound bang, or crunchbang) refers to the characters "#!" when they are the first two characters in an interpreter directive as the first line of a text file.

        There for it may look like CrunchBang but the name ArchBang is hardly applicable in the same context as Arch does not possess a Bang /! sign.

        ReplyDelete
      5. Thanks for the post. It works great for me.

        ReplyDelete
      6. Absolutely fantastic guide. I know it's linked to from the wiki (http://wiki.archlinux.org/index.php/ArchBang#Related_Links), but this guide should be made more more accessible for others.

        Good work!

        ReplyDelete
      7. You did a fantastic job
        Many thanks

        ReplyDelete
      8. Digite um texto ou endereço de um site ou traduza um documento.
        Cancelar
        Ouvir
        Tradução do português para inglês
        Hello guy can help me here I installed openbox but not open the DISPLAY environment variable error, already installed xorg and nothing!

        ReplyDelete
      9. http://tiik.org.ru/forum/viewtopic.php?id=123

        these are all packages i installed. Hope this will help somebody.

        BTW, openbox is amazing, conky shows it only needs 40mb when I first login, and after I browse for a while with firefox, it only consume 200mb ram.

        ReplyDelete
      10. Hey will, your guide is amazing dude, ive struggled with openbox for months but you really helped me get going

        theres only one thing i wish ud add to the guide or make a new guide for and thats the openbox menu

        Like your menu has the xdg addon , applications, id love to see your menu.xml to be honest

        Most of openbox is easy to understand and setup but the menu can be one of the most daunting parts from my experience

        ReplyDelete
      11. it's a great job, but one thing to add :
        I had an error when i tried startx after reboot. So, I installed consolekit to fix it. It seems that it doesn't come with the others xorg packages

        ReplyDelete
      12. i know this is an old post but figured i would ask here instead of creating a thread in forum. Love archbang been using it for a while now. i have but 1 question is i was to follow this guide to make my own version how could i make an installable iso from it afterwards to use in the future?

        ReplyDelete
      13. Just a cute work, thanks for your recommends

        ReplyDelete
      14. Thanks a lot for this great guide! It should be one of the top 10 results in Google when newcomers to Arch search for easy installation instructions. The Arch wiki is very comprehensive but a little too verbose to my taste. Mind to share where did you get that awesome wallpaper?

        ReplyDelete
        Replies
        1. Never mind, I found it in your blog. Thanks again.

          Delete
      15. Thanks! Last week I installed Archbang because of the Openbox integration.
        Your blogpost will make it much easier for me to switch to pure Arch Linux and install Openbox + all software manually.

        ReplyDelete
      16. Installed arch linux a yr ago love this guide for setup openbox. Openbox rocks. Fast, quick and stable. I get the most out of linux with Arch + Openbox imo... Thanks later. :-)

        ReplyDelete
      17. This is now outdated , arch no longer uses consolekit or dbus , please update this superB guide , we dont want anyone bjorking their install after taking the time ti install arch.

        ReplyDelete
      18. This how-to is awesome. After trying to set up Arch unsuccessfully for weeks, this guide had me up and running in no time. Thanks and major geek creds to the author.
        Regard's,
        Ben Linus,
        More here

        ReplyDelete