All of the stuff I ordered from dealextreme has finally arrived. I'll address on how I got each time working. I didn't buy any of the following item at random. I looked at this list and looked at the comments of the products on dealextreme to find out if anyone had tested it on a RPI.
0) PSU (Power source)
I ordered this power source because it's rated at 5V, 2.1A, which seemed more than enough. The problem was that this PSU has a pretty bad voltage regulation (closed circuit voltage / open circuit voltage) and while it delivers 5.2 V with no load connected, while my RPI was idle the voltage measured between TP1 and TP2 was only 4.75 V, the bare minimum recommended.
Lucky me I had the charger of my former HTC cell phone handy. It's output plug is miniUSB but I had bought a miniUSB-microUSB adapter so I could easily use it to feed my RPI. Using this HTC cell phne charge, while the RPI is idle, the voltage measured between TP1 and TP2 is 5.03 V.
1) 16GB Class10 Kingston SD card (SD10V)
Since I had an install going on my 2GB SD card, I dd'ed an image of it to my HDD (dd bs=1M if=/dev/sdd of=./arch-arm.img, /dev/sdd on my case, use lsblk to list all disks) and then dd'ed this image to my 16GB card. Then using Gparted I resized the EXT4 partition. Tried the card on the RPI but it didn't work. Dd'ed the image again but this time I didn't resize the EXT4 partition. Didn't work either.
What happens is that even though systemd started the login service, the login prompt was never displayed. I asked for help on the Arch Linux ARM (ALARM) forums. One of the developers helped me out and I thought it was just a PSU problem, but it wasn't. My current PSU keeps 5.03 V on the RPI on idle (measured from TP1 to TP2) so I reckon it's just the card reader that doesn't like it. I ended up swapping this SD card with the 4GB Class4 one of my Wii and I'm using a USB stick as the rootfs (just formatted it as EXT4, copied the files with "cp -ar" from the SD card to it and changed /etc/fstab so that /dev/sda1 was mounted as root).
The reason for running the rootfs from a USB stick was just speed, as I'm using a 4GB one and also have a 4GB SD card. I did some benchmarking using the dd command and regarding the write speed (writing a 512 MB file) I could only achieve 3.6 MB/s on the C4 SD card but got 8.1 MB/s on the USB stick. I did the same benchmark on my USB hdd (Seagate Expansion 500 GB) that I use on my Wii and managed to get 22 MB/s. Next week I'll buy a 1 TB USB hdd just for the RPI and I'll run the rootfs from there. Of course, it'll also be used to store my bittorrents downloads.
2) USB Hub
I ordered this guy. The power source of this USB hub is rated at 5 V, 4 A. Good enough, I guess. Everything I plugged on this USB hub worked properly (wifi dongle, bluetooth dongle, external hdd, wireless keyboard, etc.)
3) Wifi dongle
I ordered this one. It uses the well known RTL8188CUS chip and worked out of the box. To configure the wifi connections I used netcfg, a easy to use and lightweight solution, great when you're not using a mobile device, just set the ESSID and password for the connection and you're good to go. I'll not explain step-by-step because the Arch Wiki entry is pretty clear.
4) Wireless keyboard with touchpad
I ordered this one. It's very small, not so comfortable if you need to write a lot because only the thumbs are used to type but it's great for browsing the web, writing quick commands or using as a remote on XBMC. Also, I think the wifi signal sometimes interferes with the keyboard signal, but nothing majorly annoying.
5) Bluetooth dongle
I ordered this one. Cheap as hell and worked like a charm, Wiimote + classic controller recognized by RPI and ready to be used.
6) Heatsinks
I ordered this. It comes with 8 small heatsinks that fits perfectly the ARM CPU. I only installed a heatsink on the CPU but I also intend to install one on the USB controller and another one on the voltage regulator. These last two ones will need some customizing, I'll need to cut the heatsinks as they're too big.
---------------------------------------
Ok, so I got all the hardware I wanted (actually, I also ordered a case from modmypi.com around 10 days but it hasn't arrived yet) now I can get to the software configuration part.
Two posts ago I listed what I wanted to do with the RPI:
1) Old console emulator (mainly MAME and SNES);
2) Media center (streaming media from my desktop);
3) Torrent box (saving stuff on the SD card then ssh or ftp the stuff to my desktop);
4) Printer server (my printer is currently connected to my desktop, so if my wife wants to print something from her laptop, she needs to turn on my desktop).
Number 4 will not happen. Wifey don't want no printers in the living room.
Didn't have enough time to mess around and get number 1 working (didn't even TRY to get it working yet).
I did manage to get number 2 and 3 working properly. Like I said on my previous post, I'm using XBMC for playing H264 encoded HD videos, and it's working great.
As for number 3, I'm using Transmission. I've used Transmission ever since I ditched Windows for Linux (on Windows I used utorrent) but I've been using the regular gtk client (transmission-gtk package). What I'm using on the RPI is the transmission-cli package, running transmission as a daemon. This package also comes with transmission-remote which enables you to control the transmission-daemon from the CLI. Transmission-daemon also comes with a WebUI in case you want to control it through a web browser. As for configuring transmission, refer to the Arch Wiki entry. So, this is my basic setup, but there are some security considerations that have to be made.
About Transmission's WebUI: it supports authentication but it does not support SSL (https) connections natively (you have to so some extra work yourself, like putting a proxy in front of your server) so if you want to monitor your server from a remote network, then using this authentication is not very secure, someone eavesdropping can get your username and password and screw your server. Of course, when monitoring transmission-daemon from the LAN, there are no security problems (except for the fact that someone can break into the router by cracking your wifi signal). I want to be able to remotely check that status of my RPI Transmission-daemon, but I wanna do it in a secure manner. I decided to set up a SSH server (using SSH Keys, not username and passwords, check Arch Wiki) so I could monitor and interact with transmission-daemon using transmission-remote.
I'll not post a guide on how to setup Transmission or SSH server because the Arch Wiki entries (SSH, SSH Keys, Transmission) are very well explained. I'll just make a few remarks regarding some choices I made when configuring these servers and some stuff that people sometimes overlook:
1) When setting up a SSH server, choose a random port to run it from, don't use the default one (port 22). I ran a SSH server on my desktop one time using port 22 and going through the logs (/var/log/auth.log) I saw serveral login attempts. Changing the port eliminated the problem.
2) If you want to be able to login from outside your LAN, remember to forward the port on the router.
3) As for SSH keys, I made a 1024 bit long RSA pair. I had use RSA because I wanted to access my SSH server from a windows box (from work) using PuTTY. PuTTY doesn't support the regular OpenSSH key format, just his own key format generated using the PuTTYgen utility, and PuTTYgen only supports RSA and DSA keys. So, I had to take my private key and generate a PuTTY compatible one using PuTTYgen.
4) Since my Transmission server WebUI is not accessible from outside my LAN, I used the default port (9091) just to make things easier.
5) Remember to forward the listening port used by Transmission.
I guess that's it for now. See ya.
EDIT: I forgot to mention I signed up for a free DNS service called no-ip.com. It's working great so far and it was a breeze to install: simply install the noip client from the arch linux arm repo (pacman -S noip), run it (watch the instructions displayed after it's installed by pacman) and enable the daemon on systemd (systemctl enable noip2.service).
EDIT 2: My RPI case from modmypi.com arrived. I really recommend it. It fits very well and even though it doesn't use any screws, it's closed tight.
EDIT 3: I said I'd buy a 1TB USB hdd and run the rootfs of the RPI from there. I ended up buying a 500GB Western Digital My Passport USB 3.0 drive, even though the RPI doesn't support USB3. Anyway, it's WAY faster than running from a C4 SD card or from a USB stick. The boot is VERY fasy and the programs also load faster. Also, I'm overclocking the RPI with the following settings:
arm_freq=1000
core_freq=500
sdram_freq=500
over_voltage=6
With that and the default cpu scaling governor being "on demand", the RPI runs at 700MHz whe the CPU load is low and at 1000MHZ when the CPU load increases.
Monday, December 3, 2012
Saturday, November 17, 2012
Two Arch Linux updates and a guide on how to get Arch Linux ARM running on a Raspberry Pi.
I spent three weeks travelling because of work and the last week I was busy playing with my Raspberry Pi. I'll do a quick guide on how I got my RPI working, what packages I installed and what I could manage to do on it. But before that, I'll quckily comment on two news on the Arch Linux site:
1) ConsoleKit was replaced by logind
Anything that depended on ConsoleKit now depends on logind. This means that you can take that "ck-launch-session" from your ~/.xinitrc file if you're using systemd.
2) Support for Initscripts was dropped
I knew it was going to happen sooner or later, but I do think it was too soon. Anyway, fellow Archers, you need to adopt systemd at once!
With that said, let's go to the RPI! :)
I ordered a LOT of stuff from dealextreme, but on this post I won't cover this stuff, just the bare essentials (regular USB keyboard, regular USB mouse, wiimote as mouse and ethernet). I ordered a 16GB C10 SD card, a cordless keyboard with a touchpad, power source (microusb, 5V, 2A), externally powered USB hub, Wifi USB dongle, Bluetooth USB dongle, etc. For now, I ended up buying a usual USB keyboard and a usual USB mouse so I could start playing around. I already had an unused 2GB C4 SD card and a HDMI cable. While I was travelling I also bought a cheap 5V 1A power source (raspberrypi.org recommends at least a 700mA one).
Well, I downloaded the lastest Arch Linux ARM image from their site and followed the instructions to dd the image to the SD card. That was a piece of cake. Hooked everything up for the first boot: ethernet cable, HDMI cable, keyboard, mouse and cheap power source. The RPI didn't boot. Searching the web I found out that the most common cause for this was the quality of the power source, and I knew mine was... kinda crappy. So I had to go to bare essentials and see if it worked: HDMI cable and keyboard (took the ethernet cable and the mouse). The RPI booted.
There I saw the RPI symbol and systemd started loading a lot of stuff, including the NTP daemon and a SSH server. Right there I realized: the image is a pre-built arch install, I wouldn't have to go through all the hassle of setting everything up, just adjust the config files (vconsole.conf, set timezone and locale, etc.) and install the applications I wanted. So I logged as root (password is also root) and browsed around. The default resolution (1080p) is so high that I could barely read what I was typing on my FullHD 32" TV. So the first thing I did was lower the resolution to 720p on the /boot/config.txt file (both nano and vi are available on the base system). All parameters can be found here. After rebooting I could read everything but there were two "stripes" of unused lines on the TV, one at the bottom and one the top of the screen. I figured I'd take care of this later (and I'll show how).
So, what can one do with a Linux box without networking (remember I had to disconnect my ethernet cable so my RPI would boot)? Not much. I then remembered that I had a cellphone charger that is a microusb one rated at 5V, 850mA. This one was able to hold the ethernet and mouse. Now I was all set! I'll list everything I did to get stuff working.
-1) You'll need a GOOD power source (PSU). Most RPI problems are related to poor PSU quality. I had two problems with the cell phone charger I mentioned (one was already mentioned and the other will be covered on the next post). Get a GOOD PSU.
0) Installation
Simply download the image on this link and follow the instructions listed there. The image you'll write to your SD card will have two partitions: a FAT one (/boot) and a EXT4 one ( / ).
1) Lower the resolution
1080p is the default resolution for the RPI HDMI output. As I already said, I had to lower the resolution so I could see what I wrote. If you can see what you're writing, the resolution is good enough and you can skip this step. On this link all possible values are listed. I simply added the following to my /boot/config.txt:
hdmi_group=1
hdmi_mode=4
Like I said, this changes the resolution to 720p but still got two "stripes" of unused lines on the TV, one at the bottom and one the top of the screen. To get rid of them I added the following lines to my /boot/config.txt. I did get to these values after getting X11 running so I could be confident they were correct.
disable_overscan=1
overscan_left=37
overscan_right=37
overscan_top=23
overscan_bottom=23
2) Configuring the keyboard
Now that I could see what I wrote, I had to configure the keyboard configuration. This is done the same way as the usual arch install (using the loadkeys command and editing /etc/vconsole.conf). Check this post for details.
3) Set timezone and locale
Like the previous step, this is done just like the usual arch install. Check this post for details.
4) Change hostname
The default hostname is alarmpi. You can change this if you like:
hostnamectl set-hostname yourhostname
Of course, change yourhost name to the hostname you want.
5) Change root password and add a regular user.
This is important. The default root password is also root. You should change that. Also, add a regular user for you to use. Check this post for details.
6) Next I disabled the SSH server (don't need it at the moment, and I don't know about the default config). If you want to keep it running, simply skip this.
systemctl disable opensshd.service
systemctl stop opensshd.service
7) Sudo
Now we install sudo, edit the sudoers file (with the visudo command) and simply stop using the root user. Check this post for details.
8) Packages!
All right! Now for the best part. I'll list the packages I installed and why I installed them. You can install packages the the usual way: pacman -S packagename (of course, you'll need to do a pacman -Suy first) and search for packages using pacman -Ss packagename.
8.1) Sound
I installed the alsa-utils and alsa-plugins packages. In addition, you'll have to do type the following command as root (or sudo it) for sound to work (it loads the sound module):
modprobe snd-bcm2835
You may need to unmute the sound using alsamixer.
To make it load on startup, create the following file: /etc/modules-load.d/snd-bcm2835.conf. Then add snd-bcm2835 to it.
8.2) X11 basics
Raspberry Pi video driver: xf86-video-fbdev;
Xorg: xorg-server, xorg-server-common, xorg-server-utils, xorg-xinit;
For input: xf86-input-keyboard, xf86-input-mouse;
Basic fonts: xorg-font-utils, xor-fonts-100dpi;
8.3) Fonts, cursors, themes, etc. And lxappearance
This post has some fonts, cursors and themes you can install. I don't know if all of them are available in the Arch Linux ARM repos. Anyway, you can search for the available ones easily. Also, install lxappearance to easily configure themes, cursors, etc. Just install whatever you think looks good. :P
8.4) Applications.
I'll list what apps I installed, but you can install whatever you like. As usual, I stuck to Fluxbox as WM, but this time I won't use a login manager (usually I use slim). I used this method to login directly to X. The reason for this is that this system needs to be VERY light.
WM: fluxbox;
Utilities: galculator, thunar, vim, leafpad, feh, dmenu, gksu;
Browsers: uzbl-core, uzbl-browser, dwb;
Audio player: xmms;
Video player: xbmc-rbp-git;
I configured Fluxbox as I usually do. This post shows how I usually do it. I did swap a few applications: xfc4-appfinder for dmenu and gpicview for feh, etc. But this is because only VERY lightweight stuff must be installed on RPI (exception for XBMC which I'll talk about in a minute).
Side note: I didn't install conky, but intend to.
8.5) XBMC
As you should well know, the RPI GPU can do hardware decoding of H264 video. The "problem" is that, as far as I know, only two players can currently use the GPU instructions to do proper H264 FullHD video playback using the RPI: XBMC and OMXPlayer. OMXPlayer a CLI utility and XBMC is a fullblown Media Center. I chose XBMC because it would be easier to install (XBMC is available on the repos, OMXPlayer needs to be compiled from source).
It runs great anyway. I managed to watch The Avengers movie on 1080p. It's fantastic.
One note on XMBC: you NEED to set 128MB of RAM to the GPU for it to playback video properly. To do this, add the following to your /boot/config.txt:
gpu_mem=128
In the end, this is how the top of my /boot/config.txt file looks like (the rest of the file is commented, no use in posting it here):
# SETS GPU RAM AND RESOLUTION!
# For watching movies (128MB VRAM and 1080p resolution)
#gpu_mem=128
#hdmi_group=1
#hdmi_mode=16
# For computing (8MB VRAM and 720p resolution)
gpu_mem=8
hdmi_group=1
hdmi_mode=4
disable_overscan=1
overscan_left=37
overscan_right=37
overscan_top=23
overscan_bottom=23
As the comments say, I have two groups of settings: one for watching movies and one for general computing. The first group sets 128MB of RAM for the GPU and 1080p resolution. The second sets 8MB of RAM for the GPU (leaving more RAM for the Operating System) and 720p resolution so I can actually read stuff.
8.6) CwiiD
CWiiD enables you to use wiimote (plus nunchuck or classic controller) as input devices, provided you have a bluetooth USB dongle for the RPI. I used a regular cheap-ass one. Simply swapped the mouse for the bluetooth dongle. You only need to install the cwiid package and do some configuration. This link will tell everything you need to know to configure it. The only thing you won't find there is that you need to enable the bluetooth service:
sudo systemctl enable bluetooth.service
The next time you reboot, it'll be started. If you want to start it now:
sudo systemctl start bluetooth.service
Just as example, here's my /home/username/.cwiid/wminput file, I'm only using my wiimote as mouse.
#IR pointer
Plugin.ir_ptr.X = ABS_X
Plugin.ir_ptr.Y = ABS_Y
#buttons
Wiimote.A = BTN_LEFT
Wiimote.B = BTN_MIDDLE
Wiimote.Up = KEY_UP
Wiimote.Down = KEY_DOWN
Wiimote.Left = KEY_LEFT
Wiimote.Right = KEY_RIGHT
#Wiimote.Minus = KEY_BACK
Wiimote.Plus = BTN_RIGHT
#Wiimote.Home = KEY_HOME
#Wiimote.1 = KEY_SLASH
#Wiimote.2 = KEY_SPACE
#Nunchuk.C = BTN_LEFT
#Nunchuk.Z = BTN_RIGHT
#
#Classic.Up = KEY_UP
#Classic.Down = KEY_DOWN
#Classic.Left = KEY_LEFT
#Classic.Right = KEY_RIGHT
#Classic.Minus = KEY_BACK
#Classic.Plus = KEY_FORWARD
#Classic.Home = KEY_HOME
#Classic.A = BTN_LEFT
#Classic.B = BTN_RIGHT
#Classic.X =
#Classic.Y =
#Classic.ZL =
#Classic.ZR =
#Classic.L =
#Classic.R =
[end of tutorial]
That's it, pretty simple aye? The RPI is amazing. It's so small and can do so much. For now, I managed to playback some 1080p video, playback some mp3s, use my wiimote as mouse and browse the web. It's a full featured computer, you can do whatever you want with it. On the next post I'll tinker with the stuff I bought on dx.com to enhance my RPI experience.
1) ConsoleKit was replaced by logind
Anything that depended on ConsoleKit now depends on logind. This means that you can take that "ck-launch-session" from your ~/.xinitrc file if you're using systemd.
2) Support for Initscripts was dropped
I knew it was going to happen sooner or later, but I do think it was too soon. Anyway, fellow Archers, you need to adopt systemd at once!
With that said, let's go to the RPI! :)
I ordered a LOT of stuff from dealextreme, but on this post I won't cover this stuff, just the bare essentials (regular USB keyboard, regular USB mouse, wiimote as mouse and ethernet). I ordered a 16GB C10 SD card, a cordless keyboard with a touchpad, power source (microusb, 5V, 2A), externally powered USB hub, Wifi USB dongle, Bluetooth USB dongle, etc. For now, I ended up buying a usual USB keyboard and a usual USB mouse so I could start playing around. I already had an unused 2GB C4 SD card and a HDMI cable. While I was travelling I also bought a cheap 5V 1A power source (raspberrypi.org recommends at least a 700mA one).
Well, I downloaded the lastest Arch Linux ARM image from their site and followed the instructions to dd the image to the SD card. That was a piece of cake. Hooked everything up for the first boot: ethernet cable, HDMI cable, keyboard, mouse and cheap power source. The RPI didn't boot. Searching the web I found out that the most common cause for this was the quality of the power source, and I knew mine was... kinda crappy. So I had to go to bare essentials and see if it worked: HDMI cable and keyboard (took the ethernet cable and the mouse). The RPI booted.
There I saw the RPI symbol and systemd started loading a lot of stuff, including the NTP daemon and a SSH server. Right there I realized: the image is a pre-built arch install, I wouldn't have to go through all the hassle of setting everything up, just adjust the config files (vconsole.conf, set timezone and locale, etc.) and install the applications I wanted. So I logged as root (password is also root) and browsed around. The default resolution (1080p) is so high that I could barely read what I was typing on my FullHD 32" TV. So the first thing I did was lower the resolution to 720p on the /boot/config.txt file (both nano and vi are available on the base system). All parameters can be found here. After rebooting I could read everything but there were two "stripes" of unused lines on the TV, one at the bottom and one the top of the screen. I figured I'd take care of this later (and I'll show how).
So, what can one do with a Linux box without networking (remember I had to disconnect my ethernet cable so my RPI would boot)? Not much. I then remembered that I had a cellphone charger that is a microusb one rated at 5V, 850mA. This one was able to hold the ethernet and mouse. Now I was all set! I'll list everything I did to get stuff working.
-1) You'll need a GOOD power source (PSU). Most RPI problems are related to poor PSU quality. I had two problems with the cell phone charger I mentioned (one was already mentioned and the other will be covered on the next post). Get a GOOD PSU.
0) Installation
Simply download the image on this link and follow the instructions listed there. The image you'll write to your SD card will have two partitions: a FAT one (/boot) and a EXT4 one ( / ).
1) Lower the resolution
1080p is the default resolution for the RPI HDMI output. As I already said, I had to lower the resolution so I could see what I wrote. If you can see what you're writing, the resolution is good enough and you can skip this step. On this link all possible values are listed. I simply added the following to my /boot/config.txt:
hdmi_group=1
hdmi_mode=4
Like I said, this changes the resolution to 720p but still got two "stripes" of unused lines on the TV, one at the bottom and one the top of the screen. To get rid of them I added the following lines to my /boot/config.txt. I did get to these values after getting X11 running so I could be confident they were correct.
disable_overscan=1
overscan_left=37
overscan_right=37
overscan_top=23
overscan_bottom=23
2) Configuring the keyboard
Now that I could see what I wrote, I had to configure the keyboard configuration. This is done the same way as the usual arch install (using the loadkeys command and editing /etc/vconsole.conf). Check this post for details.
3) Set timezone and locale
Like the previous step, this is done just like the usual arch install. Check this post for details.
4) Change hostname
The default hostname is alarmpi. You can change this if you like:
hostnamectl set-hostname yourhostname
Of course, change yourhost name to the hostname you want.
5) Change root password and add a regular user.
This is important. The default root password is also root. You should change that. Also, add a regular user for you to use. Check this post for details.
6) Next I disabled the SSH server (don't need it at the moment, and I don't know about the default config). If you want to keep it running, simply skip this.
systemctl disable opensshd.service
systemctl stop opensshd.service
7) Sudo
Now we install sudo, edit the sudoers file (with the visudo command) and simply stop using the root user. Check this post for details.
8) Packages!
All right! Now for the best part. I'll list the packages I installed and why I installed them. You can install packages the the usual way: pacman -S packagename (of course, you'll need to do a pacman -Suy first) and search for packages using pacman -Ss packagename.
8.1) Sound
I installed the alsa-utils and alsa-plugins packages. In addition, you'll have to do type the following command as root (or sudo it) for sound to work (it loads the sound module):
modprobe snd-bcm2835
You may need to unmute the sound using alsamixer.
To make it load on startup, create the following file: /etc/modules-load.d/snd-bcm2835.conf. Then add snd-bcm2835 to it.
8.2) X11 basics
Raspberry Pi video driver: xf86-video-fbdev;
Xorg: xorg-server, xorg-server-common, xorg-server-utils, xorg-xinit;
For input: xf86-input-keyboard, xf86-input-mouse;
Basic fonts: xorg-font-utils, xor-fonts-100dpi;
8.3) Fonts, cursors, themes, etc. And lxappearance
This post has some fonts, cursors and themes you can install. I don't know if all of them are available in the Arch Linux ARM repos. Anyway, you can search for the available ones easily. Also, install lxappearance to easily configure themes, cursors, etc. Just install whatever you think looks good. :P
8.4) Applications.
I'll list what apps I installed, but you can install whatever you like. As usual, I stuck to Fluxbox as WM, but this time I won't use a login manager (usually I use slim). I used this method to login directly to X. The reason for this is that this system needs to be VERY light.
WM: fluxbox;
Utilities: galculator, thunar, vim, leafpad, feh, dmenu, gksu;
Browsers: uzbl-core, uzbl-browser, dwb;
Audio player: xmms;
Video player: xbmc-rbp-git;
I configured Fluxbox as I usually do. This post shows how I usually do it. I did swap a few applications: xfc4-appfinder for dmenu and gpicview for feh, etc. But this is because only VERY lightweight stuff must be installed on RPI (exception for XBMC which I'll talk about in a minute).
Side note: I didn't install conky, but intend to.
8.5) XBMC
As you should well know, the RPI GPU can do hardware decoding of H264 video. The "problem" is that, as far as I know, only two players can currently use the GPU instructions to do proper H264 FullHD video playback using the RPI: XBMC and OMXPlayer. OMXPlayer a CLI utility and XBMC is a fullblown Media Center. I chose XBMC because it would be easier to install (XBMC is available on the repos, OMXPlayer needs to be compiled from source).
It runs great anyway. I managed to watch The Avengers movie on 1080p. It's fantastic.
One note on XMBC: you NEED to set 128MB of RAM to the GPU for it to playback video properly. To do this, add the following to your /boot/config.txt:
gpu_mem=128
In the end, this is how the top of my /boot/config.txt file looks like (the rest of the file is commented, no use in posting it here):
# SETS GPU RAM AND RESOLUTION!
# For watching movies (128MB VRAM and 1080p resolution)
#gpu_mem=128
#hdmi_group=1
#hdmi_mode=16
# For computing (8MB VRAM and 720p resolution)
gpu_mem=8
hdmi_group=1
hdmi_mode=4
disable_overscan=1
overscan_left=37
overscan_right=37
overscan_top=23
overscan_bottom=23
As the comments say, I have two groups of settings: one for watching movies and one for general computing. The first group sets 128MB of RAM for the GPU and 1080p resolution. The second sets 8MB of RAM for the GPU (leaving more RAM for the Operating System) and 720p resolution so I can actually read stuff.
8.6) CwiiD
CWiiD enables you to use wiimote (plus nunchuck or classic controller) as input devices, provided you have a bluetooth USB dongle for the RPI. I used a regular cheap-ass one. Simply swapped the mouse for the bluetooth dongle. You only need to install the cwiid package and do some configuration. This link will tell everything you need to know to configure it. The only thing you won't find there is that you need to enable the bluetooth service:
sudo systemctl enable bluetooth.service
The next time you reboot, it'll be started. If you want to start it now:
sudo systemctl start bluetooth.service
Just as example, here's my /home/username/.cwiid/wminput file, I'm only using my wiimote as mouse.
#IR pointer
Plugin.ir_ptr.X = ABS_X
Plugin.ir_ptr.Y = ABS_Y
#buttons
Wiimote.A = BTN_LEFT
Wiimote.B = BTN_MIDDLE
Wiimote.Up = KEY_UP
Wiimote.Down = KEY_DOWN
Wiimote.Left = KEY_LEFT
Wiimote.Right = KEY_RIGHT
#Wiimote.Minus = KEY_BACK
Wiimote.Plus = BTN_RIGHT
#Wiimote.Home = KEY_HOME
#Wiimote.1 = KEY_SLASH
#Wiimote.2 = KEY_SPACE
#Nunchuk.C = BTN_LEFT
#Nunchuk.Z = BTN_RIGHT
#
#Classic.Up = KEY_UP
#Classic.Down = KEY_DOWN
#Classic.Left = KEY_LEFT
#Classic.Right = KEY_RIGHT
#Classic.Minus = KEY_BACK
#Classic.Plus = KEY_FORWARD
#Classic.Home = KEY_HOME
#Classic.A = BTN_LEFT
#Classic.B = BTN_RIGHT
#Classic.X =
#Classic.Y =
#Classic.ZL =
#Classic.ZR =
#Classic.L =
#Classic.R =
[end of tutorial]
That's it, pretty simple aye? The RPI is amazing. It's so small and can do so much. For now, I managed to playback some 1080p video, playback some mp3s, use my wiimote as mouse and browse the web. It's a full featured computer, you can do whatever you want with it. On the next post I'll tinker with the stuff I bought on dx.com to enhance my RPI experience.
Labels:
Arch,
Archlinux,
ARM,
cwiid,
dmenu,
Fluxbox,
HDMI,
image,
Linux,
lxappearance,
Media Center,
pacman,
Raspberry Pi,
SD card,
Systemd,
tutorial,
Wiimote,
XBMC
Sunday, October 14, 2012
Arch Linux News, a Raspberry Pi story and my plans for it!
Now it's official, systemd is now default on new installations. If anyone plans on using the last post as a guide to installing Arch Linux using the lastest install medium, the part "RUNNING A PURE SYSTEMD SYSTEM" can be skipped, as well as inserting (and removing) the line
Unless you have been living under a rock or is not as nerdy as I am, you probably have heard about the Raspberry Pi (from now on I'll just call it RPI). It's a US$ 35 credit card sized LINUX computer with a 700 MHZ ARM CPU, 256 MB of RAM and a GPU capable of decoding H264 video files (also MPEG2 if you buy the license for it). It comes with 2 USB ports, an ethernet port, a HDMI out (full size), a composite video out, a stereo audio out and some GPIOs (general purpose I/Os) . Also, it only consumes around 3.5 watts on idle. Considering the power source efficiency, other peripherals connected, etc. let's round it up to 5 watts. This means that it costs (in Recife, Brazil) US$ 0,94 a month (R$ 1,87, US$ 1 = R$ 2) to keep it turned on. This makes a pretty cheap server!
I was thinking of importing one myself, but I found this page (it's in portuguese though). You see, here in Brazil the taxes are insanely high, so importing a US$ 35 RPI would mean I'd have to pay almost US$ 150 (R$ 300) for it, converting the brazilian currency (Real) to US dollars. The main reason being: not only the taxes are high but I'd have to pay taxes over the RPI AND the shipping service, which is even pricier than the RPI (around US$40).
I looked a Mercado Livre, the brazilian ebay, and found some RPIs being sold for around US$ 125 (R$ 250). That's cheaper and the RPIs were already in Brazil, so I woundn't have to wait so much. I "bought" one. The next day though, as I got to work, I encountered a friend of mine and told him how I "got" the RPI for around US$ 125 (R$ 250). Then he turned to me and said: "Dude, Farnell Newark Brazil is selling it for US$ 87,50 (R$ 175)".
This friend of mine ended up buying one as well, so we got two RPI and shared the shipping service bill. So, I ran to my computer and cancelled my original order. The RPI ended up costing US$ 93,16 (R$ 186,32). Considering my options, not bad right?
The RPI will probably get here in the middle of this next week, but I'll be travelling for the next two weeks. In the mean time, I have already made a list of all the stuff I'll need. Since it's so cheap to keep it turned on (also, using less energy is the green thing to do!) it makes a perfect little server. I'll hook it up on my 32" LCD TV on my living room. I plan on using my RPI as a: (not listed in order of importance):
1) Old console emulator (mainly MAME and SNES);
2) Media center (streaming media from my desktop);
3) Torrent box (saving stuff on the SD card then ssh or ftp the stuff to my desktop);
4) Printer server (my printer is currently connected to my desktop, so if my wife wants to print something from her laptop, she needs to turn on my desktop).
Since it runs Linux, the possibilities are... many. I plan on using Arch Linux ARM (ARM port of Arch Linux!) with Fluxbox as WM. Later, I plan on using Xmonad or Awesome WM.
For the RPI to do those 4 things I listed, I reckon I'll need:
1) Power supply
Power is supplied to the RPI by a mini-USB port. The RPI manufacturers recommend using a supply with 700mA of rated current. I found one on the web that is able to supply 1,5A. I'll also need a full USB to mini-USB cable. I do have two spares here already, so that's taken care of.
2) SD card
The RPI doesn't have any internal memory (aside from RAM). The operating system has to be installed on a SD card for the RPI to boot it. I'll get a 16 GB class 10 Kingston SD card.
3) Keyboard and Mouse
I'll just get a USB cordless keyboard with a touch pad attached.
4) Wifi dongle.
I don't want the ethernet cable running through the living room (the router is far from the living room TV).
5) Joypad and Arcade Control (and a bluetooth dongle for Wiimote support)
I don't have a USB joypad but I have a arcade control I made several years ago (I think it was in 2002, ten years ago!):
It's simply a wooden box with arcade buttons and microswitches soldered to a generic USB joypad. Since it's been some time since I last used it, some solders have gone bad but it can be easily fixed.
Also, cwiid is also available for Arch Linux ARM! I know it's somewhat outdated but it works. I can use my wiimote + classic controller as joypad. For that to work a bluetooth dongle is needed, I do have one but sometimes my wife wants to use it on her laptop, so I'll just get a new one.
6) External HD and External DVD drive.
These are for later. My external HD is being used on my Wii at the moment and at first the 16GB SD card will do the job. A external DVD drive is simply a good addition (and if you buy the MPEG2 license, RPI will turn into a DVD player!)
7) USB Hub with external power source.
To connect all this USB stuff, nothing better than a good quality USB hub with a extrenal power source. The two USB ports of the RPI are limited to 140mA.
8) HDMI cable. Already have one lying round here unused.
What I'll need to get as of right now (prices rounded up):
1) Power supply (R$ 34);
2) 16GB class 10 SD card (R$ 70);
3) Cordless keyboard + touchpad (R$ 132);
4) Wifi dongle (R$ 60)
5) Bluetooth dongle (R$ 20)
6) USB Hub with external power source with 7 ports (R$ 54)
That comes to a total of R$ 370 (US$ 185). With shipping: R$ 428 (US$ 214) (Buying from two different online stores, so I kinda have to pay twice the shipping bill).
Anyway, a RPI + a bunch of stuff needed to get it to do what I want: R$ 186,32 + R$ 428 = R$ 614,32 (US$ 307,16). That's actually pretty expensive. The RPI in Brazil is not a low-budget computer, considering a ASUS netbook with HDMI out here in Brazil costs R$ 900 (US$ 450) and it has everything my RPI will have and more, a R$ 285 (US$ 142,50) difference.
Comparing the two situations:
Advantages of MY future RPI system (emphasis on MY because the RPI cannot be generally compared to a netbook, but considering what I want to use it for, the comparison is valid):
1) The most expensive part are the accessories, which can be used somewhere else, and if my RPI dies, I can just get a new one and hook everything up again, but with the netbook, it's all or nothing;
2) 5 watts of power consumption versus 30 watts for the netbook;
3) Comes with GPIO (not that I'll use it right away, but I'll think of something);
4) How cool is it to have such a tiny computer?!?!?!?
Advantages of the Netbook:
1) It's way faster;
2) Battery "out-of-the-box". You can adapt batteries for the RPI, but you'll need to do it yourself;
3) Comes fully finished and the RPI doesn't even come with a case;
4) Regular x86 architecture, regular Linux distro can be used, and the RPI uses ARM processor, which limits the choice of distros;
5) Has it's own display and the RPI needs a external one;
The hdd and webcam of the netbook are actually not a advantage, because I could buy a good USB hdd and a good webcam for the RPI and it's still gonna be cheaper. Also, I'm not counting the fact that a netbook is a great mobile solution because what I wanna do with the RPI doesn't need mobility. But, in the end, the advantage number 4 for the RPI is what counts!
Anyway, what is missing for my future RPI is the case. I have no idea how I'm gonna solve this yet. I'm aware of this, but I'm terrible with my hands :p. I'll figure something out though.
As soon as I start working on the RPI I'll post my progress here.
"init=/bin/systemd"
in /etc/default/grub
. I don't know if syslog-ng, cronie
and dhcpcd@eth0
are loaded by default on the new installation. It can be easily checked though: just do a sudo systemctl list-unit-files
(then press q to quit).Unless you have been living under a rock or is not as nerdy as I am, you probably have heard about the Raspberry Pi (from now on I'll just call it RPI). It's a US$ 35 credit card sized LINUX computer with a 700 MHZ ARM CPU, 256 MB of RAM and a GPU capable of decoding H264 video files (also MPEG2 if you buy the license for it). It comes with 2 USB ports, an ethernet port, a HDMI out (full size), a composite video out, a stereo audio out and some GPIOs (general purpose I/Os) . Also, it only consumes around 3.5 watts on idle. Considering the power source efficiency, other peripherals connected, etc. let's round it up to 5 watts. This means that it costs (in Recife, Brazil) US$ 0,94 a month (R$ 1,87, US$ 1 = R$ 2) to keep it turned on. This makes a pretty cheap server!
I was thinking of importing one myself, but I found this page (it's in portuguese though). You see, here in Brazil the taxes are insanely high, so importing a US$ 35 RPI would mean I'd have to pay almost US$ 150 (R$ 300) for it, converting the brazilian currency (Real) to US dollars. The main reason being: not only the taxes are high but I'd have to pay taxes over the RPI AND the shipping service, which is even pricier than the RPI (around US$40).
I looked a Mercado Livre, the brazilian ebay, and found some RPIs being sold for around US$ 125 (R$ 250). That's cheaper and the RPIs were already in Brazil, so I woundn't have to wait so much. I "bought" one. The next day though, as I got to work, I encountered a friend of mine and told him how I "got" the RPI for around US$ 125 (R$ 250). Then he turned to me and said: "Dude, Farnell Newark Brazil is selling it for US$ 87,50 (R$ 175)".
This friend of mine ended up buying one as well, so we got two RPI and shared the shipping service bill. So, I ran to my computer and cancelled my original order. The RPI ended up costing US$ 93,16 (R$ 186,32). Considering my options, not bad right?
The RPI will probably get here in the middle of this next week, but I'll be travelling for the next two weeks. In the mean time, I have already made a list of all the stuff I'll need. Since it's so cheap to keep it turned on (also, using less energy is the green thing to do!) it makes a perfect little server. I'll hook it up on my 32" LCD TV on my living room. I plan on using my RPI as a: (not listed in order of importance):
1) Old console emulator (mainly MAME and SNES);
2) Media center (streaming media from my desktop);
3) Torrent box (saving stuff on the SD card then ssh or ftp the stuff to my desktop);
4) Printer server (my printer is currently connected to my desktop, so if my wife wants to print something from her laptop, she needs to turn on my desktop).
Since it runs Linux, the possibilities are... many. I plan on using Arch Linux ARM (ARM port of Arch Linux!) with Fluxbox as WM. Later, I plan on using Xmonad or Awesome WM.
For the RPI to do those 4 things I listed, I reckon I'll need:
1) Power supply
Power is supplied to the RPI by a mini-USB port. The RPI manufacturers recommend using a supply with 700mA of rated current. I found one on the web that is able to supply 1,5A. I'll also need a full USB to mini-USB cable. I do have two spares here already, so that's taken care of.
2) SD card
The RPI doesn't have any internal memory (aside from RAM). The operating system has to be installed on a SD card for the RPI to boot it. I'll get a 16 GB class 10 Kingston SD card.
3) Keyboard and Mouse
I'll just get a USB cordless keyboard with a touch pad attached.
4) Wifi dongle.
I don't want the ethernet cable running through the living room (the router is far from the living room TV).
5) Joypad and Arcade Control (and a bluetooth dongle for Wiimote support)
I don't have a USB joypad but I have a arcade control I made several years ago (I think it was in 2002, ten years ago!):
It's simply a wooden box with arcade buttons and microswitches soldered to a generic USB joypad. Since it's been some time since I last used it, some solders have gone bad but it can be easily fixed.
Also, cwiid is also available for Arch Linux ARM! I know it's somewhat outdated but it works. I can use my wiimote + classic controller as joypad. For that to work a bluetooth dongle is needed, I do have one but sometimes my wife wants to use it on her laptop, so I'll just get a new one.
6) External HD and External DVD drive.
These are for later. My external HD is being used on my Wii at the moment and at first the 16GB SD card will do the job. A external DVD drive is simply a good addition (and if you buy the MPEG2 license, RPI will turn into a DVD player!)
7) USB Hub with external power source.
To connect all this USB stuff, nothing better than a good quality USB hub with a extrenal power source. The two USB ports of the RPI are limited to 140mA.
8) HDMI cable. Already have one lying round here unused.
What I'll need to get as of right now (prices rounded up):
1) Power supply (R$ 34);
2) 16GB class 10 SD card (R$ 70);
3) Cordless keyboard + touchpad (R$ 132);
4) Wifi dongle (R$ 60)
5) Bluetooth dongle (R$ 20)
6) USB Hub with external power source with 7 ports (R$ 54)
That comes to a total of R$ 370 (US$ 185). With shipping: R$ 428 (US$ 214) (Buying from two different online stores, so I kinda have to pay twice the shipping bill).
Anyway, a RPI + a bunch of stuff needed to get it to do what I want: R$ 186,32 + R$ 428 = R$ 614,32 (US$ 307,16). That's actually pretty expensive. The RPI in Brazil is not a low-budget computer, considering a ASUS netbook with HDMI out here in Brazil costs R$ 900 (US$ 450) and it has everything my RPI will have and more, a R$ 285 (US$ 142,50) difference.
Comparing the two situations:
Advantages of MY future RPI system (emphasis on MY because the RPI cannot be generally compared to a netbook, but considering what I want to use it for, the comparison is valid):
1) The most expensive part are the accessories, which can be used somewhere else, and if my RPI dies, I can just get a new one and hook everything up again, but with the netbook, it's all or nothing;
2) 5 watts of power consumption versus 30 watts for the netbook;
3) Comes with GPIO (not that I'll use it right away, but I'll think of something);
4) How cool is it to have such a tiny computer?!?!?!?
Advantages of the Netbook:
1) It's way faster;
2) Battery "out-of-the-box". You can adapt batteries for the RPI, but you'll need to do it yourself;
3) Comes fully finished and the RPI doesn't even come with a case;
4) Regular x86 architecture, regular Linux distro can be used, and the RPI uses ARM processor, which limits the choice of distros;
5) Has it's own display and the RPI needs a external one;
The hdd and webcam of the netbook are actually not a advantage, because I could buy a good USB hdd and a good webcam for the RPI and it's still gonna be cheaper. Also, I'm not counting the fact that a netbook is a great mobile solution because what I wanna do with the RPI doesn't need mobility. But, in the end, the advantage number 4 for the RPI is what counts!
Anyway, what is missing for my future RPI is the case. I have no idea how I'm gonna solve this yet. I'm aware of this, but I'm terrible with my hands :p. I'll figure something out though.
As soon as I start working on the RPI I'll post my progress here.
Labels:
Arcade Joystick,
Arch,
Archlinux,
comparison,
cwiid,
Emulation,
GPIO,
MAME,
Media Center,
Netbook,
Raspberry Pi,
SNES,
Systemd,
Torrent Box,
Wiimote
Friday, September 28, 2012
Archlinux + Systemd + Fluxbox + Old laptop = Impressive Speed
Alright, around two/three weeks ago I uninstalled wattOS R5 from one of my old laptops and decided I'd get Arch on it, and since I liked Fluxbox on Ubuntu so much, why not do exactly that: Archlinux + Fluxbox on this oldie laptop? Anyway, I'll try to write a guide on getting a basic Archlinux with Systemd set up. Then we'll get to a point where I install the applications (including Fluxbox) I use, you can install whatever you like though, just adapt it for your system.
"Everything" (as far as I can remember) I did I wrote on a text file so I'll post step by step what I did, but be advised, I did this a few weeks ago so I cannot be absolutely sure that EVERY command is listed here and since I don't know the specs of your computer, what's written here may not work for you. With this disclaimer: in case anyone wants to try this out and gets stuck remember that Archwiki is your friend! I didn't make any of this up, I just followed the Archwiki guide.
Also, one more advice: if you really want to do this, read the whole post before attemping to do this!
So here we go!
PRE-INSTALL
0) First download the iso boot it. :)
After booting you'll be presented just with a terminal. Don't be scared, in no time we'll have a system running.
1) First thing we do is loading the proper keyboard layout with the
2) Then we need to partition the drive(s). The tool included on the Arch cd is
and follow the instructions. Fdisk may seem wierd if you have never used it, but with a little patience you'll get there. I'd post every step I took during the execution of fdisk but I didn't take notes of them (sorry...). Alternatively you can boot any livecd of your choice (Ubuntu is a good and popular one, it has gparted, which is a pretty stright forward partitioning program) and partiton your hard drive(s) on a graphical interface program. If you're gonna run Arch, you might as well learn to use fdisk!
3) Since I used fdisk, I now had two partitons: one with 39GB (/dev/sda1) which I had to turn into a ext4 root partition and one with 1GB (/dev/sda2) which I had to turn into my swap partition. Now this is very easy:
The above command creates a ext4 file system on /dev/sda1.
The above command creates swap area on /dev/sda2.
The above command activates the swap area.
INSTALLING A BASE SYSTEM
Now we're ready to install a base system. But before that, we'll need to get the internet connection working. The easiest way (and the way I did it) is having a cabled connection to a router running a DHCP server. After getting networking working, we have to mount the root partition somewhere on our basic system, copy stuff there and then chroot into it.
4) Next we mount the hdd on /mnt of our system:
5) Then we ask for a IP address from the DHCP server:
If you wish to use a static ip address, check Archwiki for more details.
Now, before proceeding let's test if the internet connection in working:
If all goes well, we can proceed.
6) Now we can install a very basic system to our hdd that is mounted on /mnt:
7) Next we have to generate a fstab file. To do it:
8) Now we're ready to chroot into our new system! In case you don't know what chroot is, check out Archwiki. Anyway, now we do:
9) We're almost there! Now we're on the root of our new system! There's a lot of quick stuff to do:
9.1) Write your hostname to
9.2) Symlink
9.3) Set locale in
For my Brazilian friends, these might work:
9.4) Add console keymap and font preferences in
KEYMAP=br-abnt2
FONT=default8x16
9.5) Uncomment the selected locale in
9.6) Now we have to configure
Great! RAM disk is created, now we only need to install and configure grub2 so we can reboot and have a very basic system!
9.7) Now, to install grub2 on the MBR (Master boot record) of the hdd:
Now we have to edit
Also, I took
This will make your system run on a systemV/systemd hybrid setup. Later we'll make it systemd pure!
9.8) Now we have to make the grub config file:
Grub2 should be working! Now we only need...
9.9)... to setup a root password!
9.10) Now we get out of the chroot environment with
Now we can reboot!
Now take that cd out of the drive and grub2 should boot!
RUNNING A SYSTEMD PURE SYSTEM!
10) Ok, so now systemd is getting its info of which daemons to run from the
Like I said, I have a router with a DHCP server, so the last line means exactly that: ask the DHCP server for an ip address. If you're using static ip address, check the Archwiki.
I'd like to spend some time here and explain something really important. In Arch, on the contrary of Debian, Ubuntu, Fedora, etc, the system will only run programs you tell it to run. I mean, on the course of this tutorial we'll install some other daemons and for each one we'll have to enable them manually. I (and I reckon all other Archers :P) like this because everything that's running it's because you told the system to do so.
Now reboot just to check if everything is working (and it should be!)
11) Now remove the
12) Configure the package manager (pacman) by editing
13) Now, for a pure systemd system:
Now reboot. If your computer booted (and it should have), then you're running a pure systemd system. Enjoy the full speed boot!
ADDING A USER, SOUND, VIDEO, ETC.
All right! Now he have a base system booting with grub and systemd. Now we can add a regular user (you shouldn't run as root!), sound, video, wifi, desktop environment / window manager, apps, etc.
14) Firstly, we add our usual user :P. Just run the command below and change the last word "username" for the username that you want.
To add a password:
Of course, change "username" for your username and "password" for your password. :P
15) Ok, so you created your username, but having to change to root everytime you need root access is a pain. Let's install sudo:
Now we have to edit the
You should always edit the sudoers file using
Now, just below this line:
Add:
Again, change username to your username. Great, now we have sudo installed, so type:
And login using your username and passy. Now we can use sudo everytime we need root access.
16) Ok, now we'll get sound working. But before that I'll explain the very basics of how to use pacman, Arch's awesome package manager. I'll just show the most basic commands: install packages, search packages, remove packages and do system upgrades. You'll get to learn how to use pacman by using it later. So, the basic commands:
To install packages:
You can install any number of packages you want using a single line.
To search for packages to install:
string can be the package name or discription. Each package has a brief discription and this command searches these discriptions. Any matches are then displayed.
To uninstall packages:
The -R is for removal, s for removing any unnecessary dependencies and n for removing the configuration files of all packages removed.
To fully upgrade the system:
Remember: Arch is a rolling release bleeding-edge distro. Before updating, check the forums to see if any new package is braking peoples systems. It NEVER happened to me, but some people have complained about it, so you never know.
Back to the tut: simply install the alsa packages by running the command below:
I can't remember if alsamixer has to be run as root or not. Try as your regular user, if that doesn't work, then sudo it. A ncurses user interface is shown to you, so set your volumes and unmute the channels. Now run:
I had to reboot my laptop at this point so my channels would actually unmute.
17) Now we have to install X server and the video driver! Easy enough:
Now we need to find out which graphics card the computer has by doing:
Mine is a ATI XPRESS 200M 5955 so I have to install the ATI driver. In my case:
To get a list of available drivers do:
Hit q to quit. Now you probably know which driver to install. These are open-source drivers. If you want to install proprietary ones, check the Archwiki for the particular manufacturer of your graphics card.
18) Since I'm installing Arch on a laptop, I need synaptics for the touchpad:
I used the "default" configuration listed on Archwiki. Simply add those lines to
To properly setup your keyboard on X, paste the contents of this link on
The "XkbLayout" and "XkbVariant" values depend on your keyboard mapping. Check Archwiki for more info, but everything you need to know is the
19) Now we install 3 more basic X packages and then we're ready to test X:
Make sure there is no .xinitrc file on your user's home folder:
make sure:
Now we can test X by running:
You should see 3 terminals running. Exit the leftmost of them and you'll return to the CLI. If X failed, try to reboot and try again. If it still doesn't run, you (or me!) probably forgot to do (write) something. But everything should be ok.
20) Now we install some fonts to make our future desktop look better :)
21) Ok, so now I had to get AUR (Arch User Repository) working because my wifi card is really annoying and I need some aur packages to get it working. So, what is AUR you ask, it's a repository with packages made by fellow Archers that are good enough to help us less knownledgeable users to get software that's not on the main arch repos.
To get AUR working, just add this to end of your
Now run:
pacman-color is a cool program: it's pacman, with colors! :P
To use it more easily simply alias it to pacman so it gets executed instead of the regular pacman when you call pacman. Simply add this to the end of the
This way, everytime you type pacman, the shell interprets as being "sudo pacman-color". Cool right?
yaourt is the program used to install, update, search and remove aur packages. It has the same syntax of pacman but you should NEVER run it as root!
So, my wifi card is (just ran
Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)
I needed to install the package b43-firmware from aur:
Also, I blacklisted b43legacy module by adding "blacklist b43legacy" (wthout the quotes) to the file
Wifi cards are always a pain, I do expect that your wifi card setup isn't as bad as mine. Anyway, the wifi led on the laptop went on but configuring a wifi card on CLI is a pain so I waited till my window manager (Fluxbox!) was installed so I could do it on a graphical environment.
22) Now that we have a basic system with pacman and network we're ready to install Display Managers, Desktop Environments or Window Managers and all kinds of applications! Like I said in the very first paragraph of this post: this is a matter of personal taste. You can use any programs you feel comfortable. Wanna use KDE, install KDE. Wanna use Gnome, install Gnome.
For now, let's focus on the DE/WM and DM. As I already said, I'm gonna use Fluxbox as my WM. To install it:
Secondly, let's install the Display Manager. I chose (as always) SLiM. As the name says, it's the slimmest DM I know, and since the only thing a DM does is manage your logins, I see no purpose on having a fancy DM. So, to install SLiM (and some themes that go well with it):
Now, to configure SLiM (we will configure Fluxbox once we boot into it) we just have to edit
Next we copy the default
Then we have to add a line at the end of
We have to add the ck-launch-session to get automount to work (as in automounting USB keys, DVDs, etc.).
Only one more step to go, enable SLiM on systemd:
If we rebooted the computer now, then SLiM would boot and after logging in SLiM would execute Fluxbox. But, let's stick to command line some more.
23) Since I'm on a notebook, I need a wifi connection manager. I'll use wicd. To install it:
To make wicd starts after boot, well add it to systemd's services:
24) Now let's make sure our clock will always be synced. Let's install ntpd (NTP Daemon):
Now we edit
And since I'm in South-America I added the following to my ntp.conf:
server 0.south-america.pool.ntp.org iburst
server 1.south-america.pool.ntp.org iburst
server 2.south-america.pool.ntp.org iburst
server 3.south-america.pool.ntp.org iburst
To know the actual server of your continent check this out.
Now we add ntpd to systemd's services:
25) This step is optional though. There's one program I found out about recently called preload. This program "learns" which other programs you most often use and preloads some libraries they need to RAM, making them startup faster. Since I'm going for a "minimalistic" install (it could get more minimalistic, but for me this is minimalistic enough), I have some RAM to spare, and since the processor and hdd of this laptop are slow, preload comes in handy. To install it:
As usual, we add this to systemd's services:
I didn't mess with the config, but if you're willing, it's located in
26) Fantastic! Now the only thing missing are the actual programs, icons, etc. we're going to use! Again, this is a matter of personal taste. If you want chromium as your browser instead of firefox, just install it and leave firefox out. To find out the name of the package of a certain program/icon them/font/etc just use:
I'll list the programs I installed like this:
"Category" or "Why do I need it" -
Also, Archwiki has a page that lists some common programs you may want. So, let's begin.
Makes it easier configuring the UI -
Icon themes -
Cursor themes -
Bittorrent client -
Web browser (Uzbl as main and Firefox as fallback) -
Download manager -
FTP client -
Picture viewer (feh can be used to set backgrounds easily) -
Take screenshots (just do
Music player -
Video player -
CD/DVD burning -
Un/compress utilities -
Run graphical programs as root -
File manager (PCManFM) + ability to mount samba shares -
PDF reader -
Office suite -
SSH client -
Calculator -
Conky (needs no introduction I guess) -
Terminal emulator -
Text editor (like I said, I'm trying to learn vi(m), for a more usual program, you could get
NOTE: givm package now includes vim.
Programming IDE -
Task manager -
Screensaver (and lock screen!) -
Volume icon for the system tray (not needed if you install some fancy DE like gnome or KDE) -
Battery indicator (form AUR) -
Java, flash and other plugins -
NOTE: I had to install jr7-openjdk-headless twice on the first time it was in conflict with some other package I can't remember.
Ok! That was a lot of packages. To install all that:
27) One final thing before booting into Fluxbox: to get wicd's icon, slime's icon and volumeicon's icon to show on the system tray and to make xscreensaver launch on startup, one just has to add the following to
That "--interval 60" option on slime means that the battery charge level will be updated every 60 seconds.
28) Now we're ready to boot into Fluxbox (or whatever DE/WM ytou chose). Just:
And login!
29) Great, now you logged in to you DE/WM. Congrats. Now the only thing that needs to be done is configuring your DE/WM. As for configuring Fluxbox, I did something very similar to my post "Fluxbox: I liked it! :)" (post before the previous one). To get more Fluxbox styles, check this page out. To install styles, simply copy them to
Also, the default menu is very poor. To make a new one, firstly you can do the following:
And then you edit your
30) One last optional thing: after configuring everything, I ran conky and the CPU's frequency was set to 800MHz, but the rated frequency of this laptop's CPU is 1600MHz. After some researching, I found out that CPU scaling is enabled by default in current kernels (remember Arch is bleeding edge!) and it works like this: until your CPU reaches a certain load, the kernel keeps it in a low frequency state and when the load increases, it increases the CPU's frequency, that's called the "on-demand" governor, and that's the default setting set by the kernel. I'm ok with that, since lower frequency means less energy spent. But I wanted to have a way to fix it anyway, I wanted to find a way to set my governor to "performance" (rated frequency at all times). All details are here. So I just needed to install the cpupower daemon and make sure that systemd was told to run it as startup. So, here are the commands:
And to switch between "on-demand" and "performance" governors I just added the following to my
That means that pressing the super key + p switches between the "on-demand" and "performance" governors. Of course, I had to add to add the following to my sudoers file:
Or else I'd have to keep inputting my password. The shutdown and reboot commands are there also so I can use those commands on Fluxbox's menu without supplying password (see my "Fluxbox: I liked it! :)" post)
31) One final tip: it's possible to issue Fluxbox commands through bash shell using the fluxbox-remote command. I used on a script that sets my VGA-out. Everytime I returned to the native resolution of my LCD screen Fluxbox would display the task bar in the middle of the screen. It can be easily set it back to it's right place by issuing the
It took me a while to find this command. I found it on the Arch Forum but I could not find it on the Fluxbox documentation.
32) I think that's it. That's the longest post I ever did, it took me around 4 nights (kinda) to get it done and I hope it helps someone. If you have any doubts about this "tutorial" (it's a lot of info!) you can drop a comment and I'll try to help.
In the end, here's my clean desktop :P
Arch is indeed fast. Not because it's actually faster than other distros, it's just because it runs what you tell it to run, no more, no less. Just so we can get a rough figure, on my post "Fluxbox: I liked it! :)" I wrote the RAM used just after logging in on Xubuntu and on my "Xubuntu turned Fluxbox" lappy. Just so you know, here are the number again:
Xubuntu (with compositing disabled) - 165.1 MB
"Xubuntu turned Fluxbox" - 95.8 MB
Archlinux with Fluxbox described above (and with preload running) - 69.3 MB
This old lappy is blazing fast again. :)
PS: I know that I said I was gonna try Slackware, and I was really gonna, but when I looked it up on the web, I found out that the Slackware team is already almost launching Slackware 14 (rememebr that was two-three weeks ago. Funny though, TODAY, Slackware 14 was released.
"Everything" (as far as I can remember) I did I wrote on a text file so I'll post step by step what I did, but be advised, I did this a few weeks ago so I cannot be absolutely sure that EVERY command is listed here and since I don't know the specs of your computer, what's written here may not work for you. With this disclaimer: in case anyone wants to try this out and gets stuck remember that Archwiki is your friend! I didn't make any of this up, I just followed the Archwiki guide.
Also, one more advice: if you really want to do this, read the whole post before attemping to do this!
So here we go!
PRE-INSTALL
0) First download the iso boot it. :)
After booting you'll be presented just with a terminal. Don't be scared, in no time we'll have a system running.
1) First thing we do is loading the proper keyboard layout with the
loadkeys
command. You can load any keyboard layout listed on /usr/share/kbd/keymaps/
. In my case, it's a br-abnt2 keyboard. Simply type:loadkeys br-abnt2
2) Then we need to partition the drive(s). The tool included on the Arch cd is
fdisk
. Before using fdisk though, you may want to see what your current partitions are, and for that just use the lsblk
command. I just erased all partitions I had and created 2: the root (/) partition and a swap partition. This lappy only has 512MB (shared with video card) of RAM so I need a swap partition. Anyway, just type:fdisk /dev/sda
and follow the instructions. Fdisk may seem wierd if you have never used it, but with a little patience you'll get there. I'd post every step I took during the execution of fdisk but I didn't take notes of them (sorry...). Alternatively you can boot any livecd of your choice (Ubuntu is a good and popular one, it has gparted, which is a pretty stright forward partitioning program) and partiton your hard drive(s) on a graphical interface program. If you're gonna run Arch, you might as well learn to use fdisk!
3) Since I used fdisk, I now had two partitons: one with 39GB (/dev/sda1) which I had to turn into a ext4 root partition and one with 1GB (/dev/sda2) which I had to turn into my swap partition. Now this is very easy:
mkfs -t ext4 /dev/sda1
The above command creates a ext4 file system on /dev/sda1.
mkswap /dev/sda2
The above command creates swap area on /dev/sda2.
swapon /dev/sda2
The above command activates the swap area.
INSTALLING A BASE SYSTEM
Now we're ready to install a base system. But before that, we'll need to get the internet connection working. The easiest way (and the way I did it) is having a cabled connection to a router running a DHCP server. After getting networking working, we have to mount the root partition somewhere on our basic system, copy stuff there and then chroot into it.
4) Next we mount the hdd on /mnt of our system:
mount /dev/sda1 /mnt
5) Then we ask for a IP address from the DHCP server:
dhclient
If you wish to use a static ip address, check Archwiki for more details.
Now, before proceeding let's test if the internet connection in working:
ping -c 3 google.com
If all goes well, we can proceed.
6) Now we can install a very basic system to our hdd that is mounted on /mnt:
pacstrap /mnt base base-devel grub-bios
7) Next we have to generate a fstab file. To do it:
genfstab -p /mnt >> /mnt/etc/fstab
8) Now we're ready to chroot into our new system! In case you don't know what chroot is, check out Archwiki. Anyway, now we do:
arch-chroot /mnt
9) We're almost there! Now we're on the root of our new system! There's a lot of quick stuff to do:
9.1) Write your hostname to
/etc/hostname
file. Just type anything you want, mine was hp-laptop (creative right?).9.2) Symlink
/etc/localtime
to /usr/share/zoneinfo/Zone/SubZone
. Replace Zone and Subzone to your liking. In my case:ln -s /usr/share/zoneinfo/America/Recife /etc/localtime
9.3) Set locale in
/etc/locale.conf
. Even though I'm Brazilian I use default english US as my locale (I don't want software translated). So I just wrote "LANG="en_US.UTF-8"" to my /etc/locale.conf
, without the outter quotes.For my Brazilian friends, these might work:
LANG="pt_BR.UTF-8"
LANG="pt_BR ISO-8859-1"
9.4) Add console keymap and font preferences in
/etc/vconsole.conf
. Check the Archwiki for more details. I used:KEYMAP=br-abnt2
FONT=default8x16
9.5) Uncomment the selected locale in
/etc/locale.gen
and generate it with locale-gen:locale-gen
9.6) Now we have to configure
/etc/mkinitcpio.conf
and create an initial RAM disk. I used the default one, except that I added consolefont keymap
to the end of the HOOKS array. Then we have to run:mkinitcpio -p linux
Great! RAM disk is created, now we only need to install and configure grub2 so we can reboot and have a very basic system!
9.7) Now, to install grub2 on the MBR (Master boot record) of the hdd:
modprobe dm-mod
grub-install --target=i386-pc --recheck --debug /dev/sda
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
Now we have to edit
/etc/default/grub
and add the following to the GRUB_CMDLINE_LINUX line:init=/bin/systemd
Also, I took
quiet
out of the GRUB_CMDLINE_LINUX line.This will make your system run on a systemV/systemd hybrid setup. Later we'll make it systemd pure!
9.8) Now we have to make the grub config file:
grub-mkconfig -o /boot/grub/grub.cfg
Grub2 should be working! Now we only need...
9.9)... to setup a root password!
passwd
9.10) Now we get out of the chroot environment with
Crtl+D
and unmount the hd file system:umount /mnt
Now we can reboot!
reboot
Now take that cd out of the drive and grub2 should boot!
RUNNING A SYSTEMD PURE SYSTEM!
10) Ok, so now systemd is getting its info of which daemons to run from the
/etc/rc.conf
file and we'll fix that. The deafult rc.conf file only has 3 daemons on the DAEMONS array: syslog-ng, network, crond. What we'll do is enable these services on systemd so we can ditch the rc.conf file:systemclt enable syslog-ng
systemclt enable cronie
systemclt enable dhcpcd@eth0
Like I said, I have a router with a DHCP server, so the last line means exactly that: ask the DHCP server for an ip address. If you're using static ip address, check the Archwiki.
I'd like to spend some time here and explain something really important. In Arch, on the contrary of Debian, Ubuntu, Fedora, etc, the system will only run programs you tell it to run. I mean, on the course of this tutorial we'll install some other daemons and for each one we'll have to enable them manually. I (and I reckon all other Archers :P) like this because everything that's running it's because you told the system to do so.
Now reboot just to check if everything is working (and it should be!)
11) Now remove the
init=/bin/systemd
entry on /etc/default/grub
and run:grub-mkconfig -o /boot/grub/grub.cfg
12) Configure the package manager (pacman) by editing
/etc/pacman.conf
. I didn't change the default settings for now. I just ran:pacman -Syy
pacman -Syu
13) Now, for a pure systemd system:
pacman -Rsn initscripts
pacman -S systemd-sysvcompat
Now reboot. If your computer booted (and it should have), then you're running a pure systemd system. Enjoy the full speed boot!
ADDING A USER, SOUND, VIDEO, ETC.
All right! Now he have a base system booting with grub and systemd. Now we can add a regular user (you shouldn't run as root!), sound, video, wifi, desktop environment / window manager, apps, etc.
14) Firstly, we add our usual user :P. Just run the command below and change the last word "username" for the username that you want.
useradd -m -g users -G audio,games,lp,optical,power,scanner,storage,video -s /bin/bash username
To add a password:
passwd username password
Of course, change "username" for your username and "password" for your password. :P
15) Ok, so you created your username, but having to change to root everytime you need root access is a pain. Let's install sudo:
pacman -S sudo
Now we have to edit the
/etc/sudoers
file and add the regular user's username to the list of sudoers. Simply run:visudo
You should always edit the sudoers file using
visudo
because after editing it, it checks the file for any errors. Also, learn to use vi (or vim), I am begining to and I can already see why people like it so much.Now, just below this line:
root ALL=(ALL) ALL
Add:
username ALL=(ALL) ALL
Again, change username to your username. Great, now we have sudo installed, so type:
exit
And login using your username and passy. Now we can use sudo everytime we need root access.
16) Ok, now we'll get sound working. But before that I'll explain the very basics of how to use pacman, Arch's awesome package manager. I'll just show the most basic commands: install packages, search packages, remove packages and do system upgrades. You'll get to learn how to use pacman by using it later. So, the basic commands:
To install packages:
pacman -S package1 package2 package3...
You can install any number of packages you want using a single line.
To search for packages to install:
pacman -Ss string
string can be the package name or discription. Each package has a brief discription and this command searches these discriptions. Any matches are then displayed.
To uninstall packages:
pacman -Rsn package1 package2 package3...
The -R is for removal, s for removing any unnecessary dependencies and n for removing the configuration files of all packages removed.
To fully upgrade the system:
pacman -Suy
Remember: Arch is a rolling release bleeding-edge distro. Before updating, check the forums to see if any new package is braking peoples systems. It NEVER happened to me, but some people have complained about it, so you never know.
Back to the tut: simply install the alsa packages by running the command below:
sudo pacman -S alsa-utils alsa-plugins alsa-oss
alsamixer
I can't remember if alsamixer has to be run as root or not. Try as your regular user, if that doesn't work, then sudo it. A ncurses user interface is shown to you, so set your volumes and unmute the channels. Now run:
sudo alsactl store
I had to reboot my laptop at this point so my channels would actually unmute.
17) Now we have to install X server and the video driver! Easy enough:
sudo pacman -S xorg-server xorg-xinit xorg-server-utils mesa mesa-demos
Now we need to find out which graphics card the computer has by doing:
lspci | grep -i vga
Mine is a ATI XPRESS 200M 5955 so I have to install the ATI driver. In my case:
sudo pacman -S xf86-video-ati
To get a list of available drivers do:
sudo pacman -Ss xf86-video | less
Hit q to quit. Now you probably know which driver to install. These are open-source drivers. If you want to install proprietary ones, check the Archwiki for the particular manufacturer of your graphics card.
18) Since I'm installing Arch on a laptop, I need synaptics for the touchpad:
sudo pacman -S xf86-input-synaptics
I used the "default" configuration listed on Archwiki. Simply add those lines to
/etc/X11/xorg.conf.d/10-synaptics.conf
:To properly setup your keyboard on X, paste the contents of this link on
/etc/X11/xorg.conf.d/10-evdev.conf
The "XkbLayout" and "XkbVariant" values depend on your keyboard mapping. Check Archwiki for more info, but everything you need to know is the
/usr/share/X11/xkb/rules/base.lst
file. You'll figure it out. At first I used "br" and "nodeadkeys" for "XkbLayout" and "XkbVariant", respectively. But the ^'~ type chacracters did not work well (for portuguese writng, that is). To fix it, I just took the "XkbVariant" out.19) Now we install 3 more basic X packages and then we're ready to test X:
sudo pacman -S xorg-twm xorg-xclock xterm
Make sure there is no .xinitrc file on your user's home folder:
make sure:
rm ~/.xinitrc
Now we can test X by running:
startx
You should see 3 terminals running. Exit the leftmost of them and you'll return to the CLI. If X failed, try to reboot and try again. If it still doesn't run, you (or me!) probably forgot to do (write) something. But everything should be ok.
20) Now we install some fonts to make our future desktop look better :)
sudo pacman -S ttf-dejavu ttf-inconsolata ttf-liberation ttf-ubuntu-font-family
21) Ok, so now I had to get AUR (Arch User Repository) working because my wifi card is really annoying and I need some aur packages to get it working. So, what is AUR you ask, it's a repository with packages made by fellow Archers that are good enough to help us less knownledgeable users to get software that's not on the main arch repos.
To get AUR working, just add this to end of your
/etc/pacman.conf
file:[archlinuxfr]
Server = http://repo.archlinux.fr/$arch
Now run:
sudo pacman -S pacman-color yaourt
pacman-color is a cool program: it's pacman, with colors! :P
To use it more easily simply alias it to pacman so it gets executed instead of the regular pacman when you call pacman. Simply add this to the end of the
~/.bashrc
file:alias pacman='sudo pacman-color'
This way, everytime you type pacman, the shell interprets as being "sudo pacman-color". Cool right?
yaourt is the program used to install, update, search and remove aur packages. It has the same syntax of pacman but you should NEVER run it as root!
So, my wifi card is (just ran
lspci | grep -i wireless
):Network controller: Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller (rev 02)
I needed to install the package b43-firmware from aur:
pacman -Suy
yaourt -S b43-firmware
Also, I blacklisted b43legacy module by adding "blacklist b43legacy" (wthout the quotes) to the file
/etc/modprobe.d/wifi.conf
Wifi cards are always a pain, I do expect that your wifi card setup isn't as bad as mine. Anyway, the wifi led on the laptop went on but configuring a wifi card on CLI is a pain so I waited till my window manager (Fluxbox!) was installed so I could do it on a graphical environment.
22) Now that we have a basic system with pacman and network we're ready to install Display Managers, Desktop Environments or Window Managers and all kinds of applications! Like I said in the very first paragraph of this post: this is a matter of personal taste. You can use any programs you feel comfortable. Wanna use KDE, install KDE. Wanna use Gnome, install Gnome.
For now, let's focus on the DE/WM and DM. As I already said, I'm gonna use Fluxbox as my WM. To install it:
pacman -S fluxbox
Secondly, let's install the Display Manager. I chose (as always) SLiM. As the name says, it's the slimmest DM I know, and since the only thing a DM does is manage your logins, I see no purpose on having a fancy DM. So, to install SLiM (and some themes that go well with it):
pacman -S slim slim-themes archlinux-themes-slim
Now, to configure SLiM (we will configure Fluxbox once we boot into it) we just have to edit
/etc/slim.conf
. It's all there, but I usually change just two lines (and remove the # from the begining of the lines, where applicable): default_user (change it to you own instead of the one written there) so that when SLiM boots your username is already typed and current_theme (you can choose themes from /usr/share/slim/themes
, but always use the "archlinux-simplyblack" theme).Next we copy the default
.xinitrc
file to your user's home dir:cp /etc/skel/.xinitrc ~/.xinitrc
Then we have to add a line at the end of
~/.xinitrc
so that SLiM can launch the WM/DE that we have installed. In this case:exec ck-launch-session startfluxbox
We have to add the ck-launch-session to get automount to work (as in automounting USB keys, DVDs, etc.).
Only one more step to go, enable SLiM on systemd:
sudo systemctl enable slim.service
If we rebooted the computer now, then SLiM would boot and after logging in SLiM would execute Fluxbox. But, let's stick to command line some more.
23) Since I'm on a notebook, I need a wifi connection manager. I'll use wicd. To install it:
pacman -S wicd wicd-gtk
To make wicd starts after boot, well add it to systemd's services:
sudo systemctl enable wicd.service
24) Now let's make sure our clock will always be synced. Let's install ntpd (NTP Daemon):
pacman -S ntp
Now we edit
/etc/ntp.conf
And since I'm in South-America I added the following to my ntp.conf:
server 0.south-america.pool.ntp.org iburst
server 1.south-america.pool.ntp.org iburst
server 2.south-america.pool.ntp.org iburst
server 3.south-america.pool.ntp.org iburst
To know the actual server of your continent check this out.
Now we add ntpd to systemd's services:
sudo systemctl enable ntpd.service
25) This step is optional though. There's one program I found out about recently called preload. This program "learns" which other programs you most often use and preloads some libraries they need to RAM, making them startup faster. Since I'm going for a "minimalistic" install (it could get more minimalistic, but for me this is minimalistic enough), I have some RAM to spare, and since the processor and hdd of this laptop are slow, preload comes in handy. To install it:
pacman -S preload
As usual, we add this to systemd's services:
sudo systemctl enable preload.service
I didn't mess with the config, but if you're willing, it's located in
/etc/preload.conf
26) Fantastic! Now the only thing missing are the actual programs, icons, etc. we're going to use! Again, this is a matter of personal taste. If you want chromium as your browser instead of firefox, just install it and leave firefox out. To find out the name of the package of a certain program/icon them/font/etc just use:
pacman -Ss search_string
I'll list the programs I installed like this:
"Category" or "Why do I need it" -
package(s) name
Also, Archwiki has a page that lists some common programs you may want. So, let's begin.
Makes it easier configuring the UI -
lxappearance
Icon themes -
gnome-icon-theme gnome-icon-theme-extras hicolor-icon-theme human-icon-theme tangerine-icon-theme azenis-icon-theme
Cursor themes -
xcursor-vanilla-dmz xcursor-vanilla-dmz-aa xcursor-themes xcursor-bluecurve xcursor-flatbed xcursor-premium xcursor-flatbed xcursor-pinux
Bittorrent client -
transmission-gtk
Web browser (Uzbl as main and Firefox as fallback) -
uzbl-core uzbl-browser firefox
Download manager -
fatrat
FTP client -
filezilla
Picture viewer (feh can be used to set backgrounds easily) -
gpicview feh
Take screenshots (just do
import /path/to/file.jpg
to take a screenshot, but actually, imagemagick does much more) - imagemagick
Music player -
audacious
Video player -
vlc
CD/DVD burning -
xfburn
Un/compress utilities -
p7zip file-roller unrar unzip
Run graphical programs as root -
gksu
File manager (PCManFM) + ability to mount samba shares -
pcmanfm gamin gvfs gvfs-smb smbclient
PDF reader -
evince
Office suite -
libreoffice
SSH client -
putty
Calculator -
galculator
Conky (needs no introduction I guess) -
conky
Terminal emulator -
roxterm
Text editor (like I said, I'm trying to learn vi(m), for a more usual program, you could get
leafpad
or mousepad
) - gvim
NOTE: givm package now includes vim.
Programming IDE -
geany
Task manager -
lxtask
Screensaver (and lock screen!) -
xscreensaver
Volume icon for the system tray (not needed if you install some fancy DE like gnome or KDE) -
volumeicon
Battery indicator (form AUR) -
sudo yaourt -S slimebattery-git
Java, flash and other plugins -
jre7-openjdk jr7-openjdk-headless icedtea-web-java7 flashplugin gecko-mediaplayer gstreamer0.10-plugins
NOTE: I had to install jr7-openjdk-headless twice on the first time it was in conflict with some other package I can't remember.
Ok! That was a lot of packages. To install all that:
pacman -S lxappearance gnome-icon-theme gnome-icon-theme-extras hicolor-icon-theme human-icon-theme tangerine-icon-theme azenis-icon-theme xcursor-vanilla-dmz xcursor-vanilla-dmz-aa xcursor-themes xcursor-bluecurve xcursor-flatbed xcursor-premium xcursor-flatbed xcursor-pinux transmission-gtk uzbl-core uzbl-browser firefox fatrat filezilla gpicview feh imagemagick audacious vlc xfburn p7zip file-roller unrar unzip gksu pcmanfm gamin gvfs gvfs-smb smbclient evince libreoffice putty galculator conky roxterm gvim geany lxtask xscreensaver volumeicon jre7-openjdk jr7-openjdk-headless icedtea-web-java7 flashplugin gecko-mediaplayer gstreamer0.10-plugins
sudo yaourt -S slimebattery-git
27) One final thing before booting into Fluxbox: to get wicd's icon, slime's icon and volumeicon's icon to show on the system tray and to make xscreensaver launch on startup, one just has to add the following to
~/.fluxbox/startup
file (to find out where it should go, just read the file): wicd-client -t &
xscreensaver -nosplash &
slimebattery --change-icon --interval 60 &
volumeicon &
That "--interval 60" option on slime means that the battery charge level will be updated every 60 seconds.
28) Now we're ready to boot into Fluxbox (or whatever DE/WM ytou chose). Just:
sudo reboot
And login!
29) Great, now you logged in to you DE/WM. Congrats. Now the only thing that needs to be done is configuring your DE/WM. As for configuring Fluxbox, I did something very similar to my post "Fluxbox: I liked it! :)" (post before the previous one). To get more Fluxbox styles, check this page out. To install styles, simply copy them to
~/.fluxbox/styles
. Also, the default menu is very poor. To make a new one, firstly you can do the following:
pacman -S archlinux-xdg-menu
xdg_menu --fullmenu --format fluxbox --root-menu /etc/xdg/menus/arch-applications.menu >~/.fluxbox/menu
And then you edit your
~/.fluxbox/menu
to include your custom entries.30) One last optional thing: after configuring everything, I ran conky and the CPU's frequency was set to 800MHz, but the rated frequency of this laptop's CPU is 1600MHz. After some researching, I found out that CPU scaling is enabled by default in current kernels (remember Arch is bleeding edge!) and it works like this: until your CPU reaches a certain load, the kernel keeps it in a low frequency state and when the load increases, it increases the CPU's frequency, that's called the "on-demand" governor, and that's the default setting set by the kernel. I'm ok with that, since lower frequency means less energy spent. But I wanted to have a way to fix it anyway, I wanted to find a way to set my governor to "performance" (rated frequency at all times). All details are here. So I just needed to install the cpupower daemon and make sure that systemd was told to run it as startup. So, here are the commands:
sudo pacman -S cpupower
sudo systemclt enable cpupower.service
And to switch between "on-demand" and "performance" governors I just added the following to my
~/.fluxbox/keys
file.Mod4 p :ToggleCmd {Exec sudo cpupower frequency-set -g ondemand} {Exec sudo cpupower frequency-set -g performance}
That means that pressing the super key + p switches between the "on-demand" and "performance" governors. Of course, I had to add to add the following to my sudoers file:
myusername ALL=NOPASSWD:/sbin/shutdown,/sbin/reboot,/usr/bin/cpupower
Or else I'd have to keep inputting my password. The shutdown and reboot commands are there also so I can use those commands on Fluxbox's menu without supplying password (see my "Fluxbox: I liked it! :)" post)
31) One final tip: it's possible to issue Fluxbox commands through bash shell using the fluxbox-remote command. I used on a script that sets my VGA-out. Everytime I returned to the native resolution of my LCD screen Fluxbox would display the task bar in the middle of the screen. It can be easily set it back to it's right place by issuing the
Reconfigure
command on Fluxbox's menu, but I wanted to include this on the script so it would be done automatically. Anyway, here's the command I used on the script:fluxbox-remote Reconfigure
It took me a while to find this command. I found it on the Arch Forum but I could not find it on the Fluxbox documentation.
32) I think that's it. That's the longest post I ever did, it took me around 4 nights (kinda) to get it done and I hope it helps someone. If you have any doubts about this "tutorial" (it's a lot of info!) you can drop a comment and I'll try to help.
In the end, here's my clean desktop :P
Arch is indeed fast. Not because it's actually faster than other distros, it's just because it runs what you tell it to run, no more, no less. Just so we can get a rough figure, on my post "Fluxbox: I liked it! :)" I wrote the RAM used just after logging in on Xubuntu and on my "Xubuntu turned Fluxbox" lappy. Just so you know, here are the number again:
Xubuntu (with compositing disabled) - 165.1 MB
"Xubuntu turned Fluxbox" - 95.8 MB
Archlinux with Fluxbox described above (and with preload running) - 69.3 MB
This old lappy is blazing fast again. :)
PS: I know that I said I was gonna try Slackware, and I was really gonna, but when I looked it up on the web, I found out that the Slackware team is already almost launching Slackware 14 (rememebr that was two-three weeks ago. Funny though, TODAY, Slackware 14 was released.
Labels:
Arch,
Archlinux,
Config,
Configuration,
CPU Scaling,
Fluxbox,
Install,
Installation,
Laptop,
Linux,
Slackware,
Systemd
Wednesday, September 5, 2012
Arch update. (A.K.A Begone laziness!)
On july 20th, the Arch Linux developers announced that Grub legacy would not be supported anymore. On july 30th they announced that the default format of the main config file, /etc/rc.conf, has been changed. The reason of this change was to "unify the configuration of systemd and initscripts". Since I knew what initscripts were, I asked myself: wtf is systemd? A visit to the Arch wiki answered my question but I was too lazy to change anything. A few weeks passed and while I was watching a show I recently found out about, Linux Action Show, one of the news they were talking (season 23 episode 04) about was that Arch was probably gonna move to systemd. I went on the forums and there was a lot of talk about systemd. How fast it was, how many problems it was causing to some users, etc. I also read the arch-dev-public mailing list (this is the email that apparently started it all, the news that is) and well... I knew I had some work to do. I had to:
1) Ditch Grub legacy and install Grub2;
2) Update my rc.conf and create other needed files;
3) Switch to systemd.
As always, Arch wiki was a great source of information. Everything I needed was there. The switch from Grub legacy to Grub2 was very smooth (I even set a Arch wallpaper on the Grub screen). Updating my rc.conf (and creating the other files) was also smooth, just followed the wiki. I backed up all the files I had to alter but, like I said, these changes were very smooth and I ended up not using the back ups.
Now for systemd: followed the wiki and everything worked, except my samba server. But, 5 minutes later, using our good friend google, I found out that I needed to enable the nmbd daemon (the netbios name server). Easy enough:
Arch Linux is a fantastic distro. Well documented and well "put-together". Not a single hitch in such a important upgrade.
One note on systemd: it is fast! My boot time got significantly faster. This is due to the fact that systemd knows which service (daemons) needs which service and starts what it can simultaneously.
And you fellow Archer, who's been lazy to adhere to the new configs Arch has been using, you should just get it over with. Took me around one afternoon to read and actually do all the stuff I described. And who knows when Arch will drop the support for the legacy rc.conf format and systemV initscripts?
sudo systemctl enable nmbd.service
. I had forgotten about it. A 5 minute fix, I'd also call this a smooth transition.Arch Linux is a fantastic distro. Well documented and well "put-together". Not a single hitch in such a important upgrade.
One note on systemd: it is fast! My boot time got significantly faster. This is due to the fact that systemd knows which service (daemons) needs which service and starts what it can simultaneously.
And you fellow Archer, who's been lazy to adhere to the new configs Arch has been using, you should just get it over with. Took me around one afternoon to read and actually do all the stuff I described. And who knows when Arch will drop the support for the legacy rc.conf format and systemV initscripts?
Tuesday, September 4, 2012
Fluxbox: I liked it! :)
On my last post I said that I was gonna try Openbox and Fluxbox WMs. I'd install Fluxbox on my Xubuntu laptop (gotta keep it with Xubuntu so I can have a system like my wife's in case she needs it) and on my other laptop I'd install Archbang, a preconfigured Arch Linux that comes with Openbox as WM.
Firstly, I tried to install Archbang but I'd always get the same error (crazy dump code on the screen a few seconds after the system is fully loaded). I tried it using a CD (actually, two, since my first guess was that I had a bad burn) and then wrote the CD image to a USB stick (see this) and tried booting from it (using plop, see my sixth post) but got the same error. The weird part is that I tried both the CD and USB stick on my other laptop and both worked without a hitch, but didn't go through with the Archbang installation though. I have no idea what is the issue, so I gave up on the idea of installing Archbang... for now.
The other part of my plan was to install Fluxbox on my Xubuntu laptop, which was easy enough to do:
I should have taken a screenshot of the desktop just after I logged in. I forgot and I only have a screenshot of my current desktop. What I will do is describe my impressions of Fluxbox and what I had to do to have the desktop you see below.
Before I write down how I got to this desktop, I have to say my feelings about this WM: like the title of the post says, I liked it. I actually liked it enough to keep it as my main WM on this laptop for just two reasons: it's fast and functional. The first thing you notice after logging in is that Fluxbox is very responsive, menus pop up instantly and it loads really fast, unlike the stock Xubuntu. The amount of RAM it takes is very small, making more room for other programs to run. After booting and logging in, only 95.8 MB of RAM is used. In the case of the stock Xubuntu (and with compositing disabled!), 165.1 MB of RAM is taken just after logging in on this same laptop! And that's with compositing disabled! I also liked the fact that using Fluxbox will make you go to the terminal sometimes, which to me is actually a good thing. Also, we'll see below that the most part of the configuration is done on text files. That's why it's such a fast WM: it has a simple text-based configuration scheme. It's a functional WM because it's easely configured and completely configurable. It may take sometime to make it look and feel just the way you like it, but once you get to that point it's a fantastic WM. I plan to install some major distro (probably Slackware, since I always wanted to try it) on my other laptop and use the same configuration files I made on this Fluxbox setup. To sum up, for me, Fluxbox is fast and functional, but if you don't like the CLI or making configs on text files (*ahem* Unity *ahem*), Fluxbox may not be for you.
Now then, I'm ready to describe my experience, step by step. The first time I logged in I got a black wallpaper with a Ubuntu logo and a grey bar on the lower side of the screen, which is the toolbar. Also, there were no icons on the desktop, and to get any icons on it, a separate program is needed: idesk. Didn't install it though, I don't need stinking icons on the desktop. :) The usual way you interact with Fluxbox is by right-clicking on the desktop. By doing that, you'll get a menu with a lot of options, from Applications menu to Configurations menus that will help you customize your Fluxbox environment. Now, in the beginning of the "config process" it's worth noting a few menus: Configuration, that lets you set transparency, toolbar options, etc, Styles that lets you set a visual style for the menus and Workspaces which lets you set how many workspaces you want.
After logging in, I opened thunar, the XFCE file manager, and found out that no icons appeared. I mean, I saw the directories, but no icons appeared. A bit of googling around pointed me to a little program called lxappearance. The program is very straight forward and it lets you choose the icon theme, mouse icons, etc.
With thunar configured, it was time to set the wallpaper. Like the guy shows on the video:
Having set the wallpaper I figured it was time to customize my right-click menu, the most important menu of Fluxbox! I did just like the guy on the video: edited ~/.fluxbox/menu file and added what I needed. The syntax is very straight forward and easy to pick up. The most difficult part was to find the icons I wanted to place beside the menu entries. I just added the programs I use the most, one menu just for the main Fluxbox configuration files (menu, startup, keys, init), a reboot entry and a shutdown entry. Here's how my menu file turned out:
[begin] (Fluxbox!)
[exec] (LeafPad) {/usr/bin/leafpad} </usr/share/icons/hicolor/32x32/apps/leafpad.png>
[exec] (Thunar) {/usr/bin/thunar} </usr/share/icons/hicolor/48x48/apps/Thunar.png>
[exec] (Spyder) {/usr/bin/spyder} </usr/share/app-install/icons/spyder.png>
[exec] (Audacious) {/usr/bin/audacious} </usr/share/icons/hicolor/48x48/apps/audacious.png>
[exec] (SMPlayer) {/usr/bin/smplayer} </usr/share/icons/hicolor/32x32/apps/smplayer.png>
[exec] (Xfce Application Finder) {xfce4-appfinder} </usr/share/icons/hicolor/48x48/apps/xfce4-appfinder.png>
[exec] (Task Manager) {xfce4-taskmanager} </usr/share/app-install/icons/utilities-system-monitor.png>
[exec] (Xfce Terminal) {/usr/bin/xfce4-terminal} </usr/share/app-install/icons/terminal-tango.png>
[exec] (Chromium) {/usr/bin/chromium-browser} </usr/share/icons/hicolor/32x32/apps/chromium-browser.png>
[exec] (Lock Screen) {/usr/bin/xscreensaver-command -lock} </usr/share/icons/gnome/48x48/status/changes-prevent.png>
[exec] (LibreOffice) {/usr/bin/libreoffice} </usr/share/icons/hicolor/32x32/apps/libreoffice-main.png>
[exec] (Calculator) {/usr/bin/galculator} </usr/share/app-install/icons/accessories-calculator.png>
[separator]
[submenu] (Fluxbox Config!) {}
[exec] (Menu) {/usr/bin/leafpad ~/.fluxbox/menu} <>
[exec] (Keys) {/usr/bin/leafpad ~/.fluxbox/keys} <>
[exec] (Startup) {/usr/bin/leafpad ~/.fluxbox/startup} <>
[exec] (Init) {/usr/bin/leafpad ~/.fluxbox/init} <>
[end]
[separator]
[include] (/etc/X11/fluxbox/fluxbox-menu)
[separator]
[exec] (Reboot) {sudo reboot} <>
[exec] (Shutdown) {sudo shutdown -h now} <>
[end]
This menu looks like this:
To get the last two commands working without supplying the password (which would be kinda boring having to supply my password every time I wanted to shutdown or reboot) I added the following lines to my sudoers file:
%sudo ALL=(ALL:ALL) ALL
%sudo ALL=NOPASSWD: /sbin/shutdown,/sbin/reboot
The next file I attacked was the ~/.fluxbox/keys. This file sets the keyboard shortcuts. It's also a very important part of the Fluxbox experience. Relying only on the right-click menu to run programs is not practical sometimes. Again, customizing the keys file is easy enough. Below are the lines I added myself to the default keys file:
# Functionalities
Mod4 Right :NextWorkspace
Mod4 Left :PrevWorkspace
Control 1 :Workspace 1
Control 2 :Workspace 2
Mod4 d :ShowDesktop
Mod4 l :Exec xscreensaver-command -lock
# Apps
Mod4 w :Exec chromium-browser
Mod4 e :Exec thunar
Mod4 t :Exec xfce4-terminal
Mod4 r :Exec xfce4-appfinder
Mod4 c :ToggleCmd {Exec pkill conky} {Exec conky -c ~/.conkyrc}
Control means the Ctrl key, Mod1 means Alt and Mod4 means the "super" (a.k.a Windows) key. The commands above are self explanatory, maybe except for the last one, which I'll explain. I set up conky to be started upon startup (see below), so that command toggles conky on/off. This ToggleCmd command is simple and brilliant, it simply commutes between two states. There are other Fluxbox commands like MacroCmd that executes several commands at once (see here for more details). Also, ToggleCmd, MacroCmd and others can be combined. There are many customizing possibilities.
Next: the ~/.fluxbox/startup file. This script is read and executed by the program
xscreensaver &
nm-applet &
volumeicon &
conky -c ~/.conkyrc &
This is the stuff I run at startup. The first and the last probably don't need any explanation (just so you know, I based my .conkyrc file on this). As for the two in the middle, when you first log into Fluxbox, there are no icons on the task bar. So I needed icons for NetworkManager (for wifi) and a volume icon to appear, and that's how it's done. Easy or what?
After I put those icons on my toolbar, they were not on the corner like I wanted them to be. That brings me to the last file I edited: ~/.fluxbox/init. This file sets the overall "look" of Fluxbox, including the toolbar. I only edited the line that sets what the toolbar must contain. It ended up like this:
session.screen0.toolbar.tools: iconbar, clock, systemtray
That line says that, from left to right, the toolbar contains an area for the iconbar, where the running windows are displayed, the clock (which you can configure how you want it by right-clicking on it) and the systemtray that, in my case, shows the NetworkManager and the volume icons.
After all that, I managed to get my desktop the way I showed in the beginning of the post. :)
There are a lot of other stuff that I didn't have time to explore, such as the ~/.fluxbox/apps file and the slit (there's even more stuff, of course). But from what I have already seen, I really liked this WM. For those willing to try it, the Fluxbox Wiki is a great source of information.
I'll see if I can get Slackware running with Fluxbox on my other laptop. In the mean time, I'll install Openbox on this "Xubuntu turned Fluxbox" laptop. Let's see how that turns out.
Firstly, I tried to install Archbang but I'd always get the same error (crazy dump code on the screen a few seconds after the system is fully loaded). I tried it using a CD (actually, two, since my first guess was that I had a bad burn) and then wrote the CD image to a USB stick (see this) and tried booting from it (using plop, see my sixth post) but got the same error. The weird part is that I tried both the CD and USB stick on my other laptop and both worked without a hitch, but didn't go through with the Archbang installation though. I have no idea what is the issue, so I gave up on the idea of installing Archbang... for now.
The other part of my plan was to install Fluxbox on my Xubuntu laptop, which was easy enough to do:
sudo apt-get install fluxbox
, on a xfce terminal. Before trying Fluxbox, I watched this video on youtube that shows the basic configuration of Fluxbox. If you've never used it and want to try, I recommend watching this video, it's very didactic. After watching the video I figured it was time to actually try Fluxbox. Rebooted, marked "Fluxbox" on the session field of LighDM and logged in.I should have taken a screenshot of the desktop just after I logged in. I forgot and I only have a screenshot of my current desktop. What I will do is describe my impressions of Fluxbox and what I had to do to have the desktop you see below.
![]() |
Current desktop. |
Now then, I'm ready to describe my experience, step by step. The first time I logged in I got a black wallpaper with a Ubuntu logo and a grey bar on the lower side of the screen, which is the toolbar. Also, there were no icons on the desktop, and to get any icons on it, a separate program is needed: idesk. Didn't install it though, I don't need stinking icons on the desktop. :) The usual way you interact with Fluxbox is by right-clicking on the desktop. By doing that, you'll get a menu with a lot of options, from Applications menu to Configurations menus that will help you customize your Fluxbox environment. Now, in the beginning of the "config process" it's worth noting a few menus: Configuration, that lets you set transparency, toolbar options, etc, Styles that lets you set a visual style for the menus and Workspaces which lets you set how many workspaces you want.
After logging in, I opened thunar, the XFCE file manager, and found out that no icons appeared. I mean, I saw the directories, but no icons appeared. A bit of googling around pointed me to a little program called lxappearance. The program is very straight forward and it lets you choose the icon theme, mouse icons, etc.
With thunar configured, it was time to set the wallpaper. Like the guy shows on the video:
fbsetbg -a /path/to/picture.jpg &
. This, in my case, did not make this setting persistent, that is, after rebooting, the wallpaper that was up was the Ubuntu default one. To solve this, I had to put this command on the ~/.fluxbox/startup file (more on this file below). The weird part is that I commented this line I had added on the startup file and set a new wallpaper using the same command but a different picture. It just worked, I got a persistent wallpaper.Having set the wallpaper I figured it was time to customize my right-click menu, the most important menu of Fluxbox! I did just like the guy on the video: edited ~/.fluxbox/menu file and added what I needed. The syntax is very straight forward and easy to pick up. The most difficult part was to find the icons I wanted to place beside the menu entries. I just added the programs I use the most, one menu just for the main Fluxbox configuration files (menu, startup, keys, init), a reboot entry and a shutdown entry. Here's how my menu file turned out:
[begin] (Fluxbox!)
[exec] (LeafPad) {/usr/bin/leafpad} </usr/share/icons/hicolor/32x32/apps/leafpad.png>
[exec] (Thunar) {/usr/bin/thunar} </usr/share/icons/hicolor/48x48/apps/Thunar.png>
[exec] (Spyder) {/usr/bin/spyder} </usr/share/app-install/icons/spyder.png>
[exec] (Audacious) {/usr/bin/audacious} </usr/share/icons/hicolor/48x48/apps/audacious.png>
[exec] (SMPlayer) {/usr/bin/smplayer} </usr/share/icons/hicolor/32x32/apps/smplayer.png>
[exec] (Xfce Application Finder) {xfce4-appfinder} </usr/share/icons/hicolor/48x48/apps/xfce4-appfinder.png>
[exec] (Task Manager) {xfce4-taskmanager} </usr/share/app-install/icons/utilities-system-monitor.png>
[exec] (Xfce Terminal) {/usr/bin/xfce4-terminal} </usr/share/app-install/icons/terminal-tango.png>
[exec] (Chromium) {/usr/bin/chromium-browser} </usr/share/icons/hicolor/32x32/apps/chromium-browser.png>
[exec] (Lock Screen) {/usr/bin/xscreensaver-command -lock} </usr/share/icons/gnome/48x48/status/changes-prevent.png>
[exec] (LibreOffice) {/usr/bin/libreoffice} </usr/share/icons/hicolor/32x32/apps/libreoffice-main.png>
[exec] (Calculator) {/usr/bin/galculator} </usr/share/app-install/icons/accessories-calculator.png>
[separator]
[submenu] (Fluxbox Config!) {}
[exec] (Menu) {/usr/bin/leafpad ~/.fluxbox/menu} <>
[exec] (Keys) {/usr/bin/leafpad ~/.fluxbox/keys} <>
[exec] (Startup) {/usr/bin/leafpad ~/.fluxbox/startup} <>
[exec] (Init) {/usr/bin/leafpad ~/.fluxbox/init} <>
[end]
[separator]
[include] (/etc/X11/fluxbox/fluxbox-menu)
[separator]
[exec] (Reboot) {sudo reboot} <>
[exec] (Shutdown) {sudo shutdown -h now} <>
[end]
This menu looks like this:
![]() |
My Fluxbox menu! |
To get the last two commands working without supplying the password (which would be kinda boring having to supply my password every time I wanted to shutdown or reboot) I added the following lines to my sudoers file:
%sudo ALL=(ALL:ALL) ALL
%sudo ALL=NOPASSWD: /sbin/shutdown,/sbin/reboot
The first line says that members of the group sudo can supply admin commands using sudo (duh!) and the second line says that members of the group sudo do not need to supply a password to execute the commands reboot and shutdown.
# Functionalities
Mod4 Right :NextWorkspace
Mod4 Left :PrevWorkspace
Control 1 :Workspace 1
Control 2 :Workspace 2
Mod4 d :ShowDesktop
Mod4 l :Exec xscreensaver-command -lock
# Apps
Mod4 w :Exec chromium-browser
Mod4 e :Exec thunar
Mod4 t :Exec xfce4-terminal
Mod4 r :Exec xfce4-appfinder
Mod4 c :ToggleCmd {Exec pkill conky} {Exec conky -c ~/.conkyrc}
Control means the Ctrl key, Mod1 means Alt and Mod4 means the "super" (a.k.a Windows) key. The commands above are self explanatory, maybe except for the last one, which I'll explain. I set up conky to be started upon startup (see below), so that command toggles conky on/off. This ToggleCmd command is simple and brilliant, it simply commutes between two states. There are other Fluxbox commands like MacroCmd that executes several commands at once (see here for more details). Also, ToggleCmd, MacroCmd and others can be combined. There are many customizing possibilities.
Next: the ~/.fluxbox/startup file. This script is read and executed by the program
/usr/bin/startfluxbox
(which is the program that starts the Fluxbox session). Here are the lines I added:xscreensaver &
nm-applet &
volumeicon &
conky -c ~/.conkyrc &
This is the stuff I run at startup. The first and the last probably don't need any explanation (just so you know, I based my .conkyrc file on this). As for the two in the middle, when you first log into Fluxbox, there are no icons on the task bar. So I needed icons for NetworkManager (for wifi) and a volume icon to appear, and that's how it's done. Easy or what?
After I put those icons on my toolbar, they were not on the corner like I wanted them to be. That brings me to the last file I edited: ~/.fluxbox/init. This file sets the overall "look" of Fluxbox, including the toolbar. I only edited the line that sets what the toolbar must contain. It ended up like this:
session.screen0.toolbar.tools: iconbar, clock, systemtray
That line says that, from left to right, the toolbar contains an area for the iconbar, where the running windows are displayed, the clock (which you can configure how you want it by right-clicking on it) and the systemtray that, in my case, shows the NetworkManager and the volume icons.
After all that, I managed to get my desktop the way I showed in the beginning of the post. :)
There are a lot of other stuff that I didn't have time to explore, such as the ~/.fluxbox/apps file and the slit (there's even more stuff, of course). But from what I have already seen, I really liked this WM. For those willing to try it, the Fluxbox Wiki is a great source of information.
I'll see if I can get Slackware running with Fluxbox on my other laptop. In the mean time, I'll install Openbox on this "Xubuntu turned Fluxbox" laptop. Let's see how that turns out.
Sunday, August 26, 2012
New Mobo, no hassle!
Hi all, a few weeks ago the motherboard of my desktop started giving some ageing signals such as not saving BIOS settings (before you ask, I did change the battery, twice actually, probably something is short circuiting the BIOS "feeder"?), not detecting my IDE hard drive and burner and a USB port died. The specs of my desktop:
- Mobo: 5-year-old Gigabyte GA-945GCMX-S2
- CPU: 5-year-old Pentium Dual-Core E2200
- RAM: 4GB DDR2 RAM
- Video: Nvidia Geforce 8400
- Onboard LAN and Sound Cards
Anyway, I spent a few days looking on the web which new mobo to buy (it's not easy to find Mobos for a Pentium Dual Core CPU - LGA 775 in august of 2012!) and I wanted one that supported DDR2 RAM as I didn't want to buy new RAM. Couldn't find a DDR2 compatible one, just DDR3 compatible. So I ended up getting a ASUS P5G41T-M LX2 mobo and two 2GB DDR3 RAM Kingston sticks.
After I made the purchase and while waiting for it to arrive by mail, I started wondering: Do I have to do anything to my Arch Linux setup? Will I have to install new drivers? Will I have to install Arch again? By this time I remembered that if I were using Windows XP I'd have to reinstall everything, or else the system gets plain unusable. A Arch Linux install is something fantastic... to do once! You learn a LOT in the process, but it's something that takes a few hours (more like 4 or 5 hours) to be done.
At this point, I was... desperate! I started googling around and found that Arch was not gonna "feel" anything provided my hard drives were correctly mapped on my /etc/fstab file and that I didn't change architectures (i686 versus x86_64). I already used UUIDs on fstab so that was taken care of and since the CPU was gonna be the same, there was no need to change architectures (I use i686 Arch). I was still not believing it but what choice did I have anyway?
At this point, I was... desperate! I started googling around and found that Arch was not gonna "feel" anything provided my hard drives were correctly mapped on my /etc/fstab file and that I didn't change architectures (i686 versus x86_64). I already used UUIDs on fstab so that was taken care of and since the CPU was gonna be the same, there was no need to change architectures (I use i686 Arch). I was still not believing it but what choice did I have anyway?
So I took the old mobo out, put on the new one with the new RAM sticks and pressed the power button. Slim booted alright. Logged in to my usual XFCE desktop. When I saw that the network worked without having to install another driver, I knew I was home free. Indeed, everything worked.
So, there you are, another advantage of Linux over Windows: in case you have to change motherboards, no need to reinstall everything! :)
PS: Since I was afraid to have to end up reinstalling Arch, I looked up for the Archbang, which is a preconfigured Arch setup with Openbox as window manager. After installing it you end up with a Arch + Openbox. So, if I had to reinstall Arch, I could just install Archbang, remove Openbox and install XFCE. While doing this little research, I got curious about Openbox and Fluxbox. So I have decided: On my Xubuntu laptop I'll install Fluxbox and on my other laptop I'll remove wattOS R5 and install Archbang. After getting a feeling of these two WMs I'll try to write something here on the blog about them.
Subscribe to:
Posts (Atom)