Search results for: Openbox

Exploring with Gentoo Linux (Part 3)

Part 3 - Setting up i3 Window Manager

It's been a couple of years since I started using Tiling Window Manager. I first started with Awesome because it's said that this window manager was somewhat between floating and tiling window manager. It uses Lua to configure the system. It's not the easiest language to learn, but not the most difficult one, either. I liked it but I found a bit cumbersome to arrange windows the way I wanted. So, I migrated over to i3.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

I love i3 for its simplicity and text based configuration file. It's fast, powerful and supports multi-monitors well. I don't think I can go back to any other Window Managers anymore.

X11:

Updated: Updated article about X11

To use i3 Window Manager, X Window System needs to be installed. # emerge --ask x11-base/xorg-drivers # emerge --ask x11-base/xorg-server

When the installation is finished, some environment variables will need to re-initialized before continuing. Source the profile with this command:# env-update # source /etc/profile

NVIDIA Driver:

Updated: Updated article about NVIDIA Driver

I have a rather old NVIDIA GeForce GTS 450. For some reasons, the latest drivers from the nvidia website always doesn't work even though it says its compatible with my graphic card. So, I use the one I know it works from before.# sh NVIDIA-Linux-x86_64-390.116.run

i3 Window Manager:

The installation of i3wm is straight forward.# emerge --ask x11-wm/i3

After i3wm is successfully installed, we need a way to execute it and get into i3 window environment. To do this, ~/.xinitrc needs to be created. This is the file when startx and xinit are run and execute it. If this file is not present, startx run the default from /etc/X11/xinit/xinitrc.$ nvim ~/.xinitrc ========== exec i3

Then, we need to update ~/.xinitrc to load ~/.Xresources automatically each time startx is executed so the config is loaded into urxvt.$ nvim ~/.xinitrc ========== [[ -f ~/.Xresources ]] && xrdb -merge -I$HOME ~/.Xresources exec i3

Rofi:

Rofi is a window switcher, run dialog, ssh-launcher and dmenu replacement that I've been using since the day I switched to i3 Window Manager.# emerge x11-misc/rofi

i3pystatus:

Installation of i3pystatus is straightforward. To display icons, I'd need Font Awesome installed.# emerge --ask media-fonts/fontawesome

Then, install pip, Python's package management system.# emerge --ask dev-python/pip

Using pip, i3pystatus can be installed. The --user option is needed because I'm installing it as a regular user. This will install it user's $HOME directory ($HOME/.local/): $ pip install --user i3pystatus

As mentioned before, i3pystatus was installed under $HOME/.local/bin/, this needs to be added to $PATH.

Finally, install some modules to display volume, memory usage, disk usage, network status, etc.

Updated: Updated article about Python Modules
$ pip install --user colour \ netifaces \ psutil

New: Pop-up Calendar Applet

gsimplecal:

I wanted a simple calendar applet to pop up when the date/time field in i3pystatus is clicked. What I was looking for is something simple, small, and lightweight calendar app, and narrowed down to Orage and gsimplecal. Orage is from XFCE, known its lightweight desktop environment, and gsimplecal is written in C++ using GTK for OpenBox. Both are simple and lightweight, but I decided to use gsimplecal because I can control its behavior from a config file.$ cd /tmp $ git clone git://github.com/dmedvinsky/gsimplecal.git $ cd gsimplecal $ ./autogen.sh $ ./configure $ make ... Unique.cpp:7:10: fatal error: sys/sysctl.h: No such file or directory 7 | #include <sys/sysctl.h> |

At this point, it failed on my system because sysctl.h is under /usr/include/linux/ directory. To fix this issue, simply edit the affected Unique.cpp under gsimplecal/src/ directory.

After correcting the path for the header file, re-run the make command and continue installing the app$ make $ make install

Then create a config file under ~/.config/gsimplecal/ and enter the following config values:$ mkdir ~/.config/gsimplecal $ cd ~/.config/gsimplecal/ $ nvim config ================== show_calendar = 1 show_timezones = 1 mark_today = 1 show_week_numbers = 1 close_on_unfocus = 0 external_viewer = sunbird \-showdate "%Y\-%m\-%d" clock_format = %a %d %b %H:%M force_lang = en_US.utf8 mainwindow_decorated = 0 mainwindow_keep_above = 1 mainwindow_sticky = 0 mainwindow_skip_taskbar = 1 mainwindow_resizable = 0 mainwindow_position = none mainwindow_xoffset = 1690 mainwindow_yoffset = 845 clock_label = Local clock_tz = clock_label = Tokyo clock_tz = :Asia/Tokyo clock_label = Taiwan clock_tz = :Asia/Taipei

The last step is to integrate gsimplecal to i3pystatus.$ nvim ~/.config/i3/pystatusconfig.py ================== ... status.register("clock", format="%b %e (%a) %H:%M %p ", color="#fffff3", interval=1, on_rightclick="gsimplecal", on_leftclick="gsimplecal", ) ...

That's all!
-gibb

Exploring with Gentoo Linux (Part 2)

Part 2 - Configuring Other Applications

Git:

Git is distributed revision control and source code management software. I need to install git first because I have dotfiles and config files for the applications I need. # emerge --ask dev-vcs/git

After the installation, following config settings need to be done at least.$ git config --global user.name "my_username" $ git config --global user.email "my_email"

Then, download the dotfiles from Github.$ cd ~/ $ git clone https://github.com/ubyt3m3/dotfiles.git ... $ ls dotfiles

st:

st is a simpke terminal for X. I use this terminal until I finish setting up urxvt. savedconfig USE flag lets you save a customized configuration file to /etc/portage/savedconfig/x11-terms/st.# echo "x11-terms/st savedconfig" > /etc/portage/package.use/st # emerge --ask x11-terms/st

Rxvt-unicode:

Rxvt-unicode (urxvt) is THE terminal emulator that I must have in my work environment since OpenBox days. It's fast, lean, highly customizable and can display different fonts. I have another post regarding how I customize it.

Gentoo Linux allows you to choose what options to enable or disable using the USE flags. The options I wanted to enable were the followings:

  • 256-color: Enable 256 color support
  • unicode3: Use 21 instead of 16 bits to represent unicode characters
  • xft: Build with support for XFT font renderer (x11-libs/libXft)
  • gdk-pixbuf: Build with support for image loading and manipulation. Need this for image previewing in ranger

There are a few ways to do this in Gentoo. Since I wanted to do per package base, I set it in the /etc/portage/package.use/ directory:# echo "x11-terms/rxvt-unicode 256-color unicode3 xft gdk-pixbuf" > /etc/portage/package.use/rxvt-unicode # emerge --ask x11-terms/rxvt-unicode or set it during the installation:# USE="256-color unicode3 xft gdk-pixbuf" emerge --ask x11-terms/rxvt-unicode

Its config file is ~/.Xresources.

Updated: Updated article about Xresources

Neovim:

Neovim is a fork of Vim that promised to fix issues with Vim and provide a better out-of-the-box experience for Vim users. It also includs a built in terminal emulator.

Installation is simple.# emerge --ask app-editors/neovim

Its configuration file is in ~/.config/nvim/init.vim and I use vim-plug plug-in to handle installation of other plug-ins. Once my init.vim is copied to its config directory, run nvim. It should install defined plug-ins automatically. If it doesn't, go into the Normal/Command mode by hitting Esc. Then type :PlugInstall. This should trigger installation of plug-ins.

PCManFM:

PCManFM is a GUI file manager. It's light weight and has features like displaying mounted drives and dual panes. I don't usually use it but it's good to have as a backup.# emerge --ask x11-misc/pcmanfm

Faenza Icons and gtk2 theme:

Faenza is an icon theme for Gnome. I've looked around and liked it the most. It can be installed from Portage. # emerge --ask x11-themes/faenza-icon-theme

Icons and GTK2 theme can be applied from lxappearance, but it needs to be installed first. # emerge --ask lxde-base/lxappearance

My customized Morning Glory needs to be extracted to ~/.themes/.$ tar -xzvf MorningGlory.tar.gz -C ~/.themes/

Once the icons and theme have been prep'ed, run lxappearance to apply them.

For the theme, click on the Widget tab. Morning Glory should be listed in the left pane.

Icons

For the icon theme, click on the Icon Theme tab, and choose Faenza from the list in the left pane.

Ranger:

Ranger is a text-based file manager. The best feature for me is the vi-style keybinding. # emerge --ask app-misc/ranger

The default directory is ~/.config/ranger/ and you can copy the default configuration files to this directory.$ ranger --copy-config=all

Copied files are the followings:

  • rc.conf - startup commands and key bindings
  • commands.py - commands which are launched with :
  • rifle.conf - applications used when a given type of file is launched.

For image preview, w3m needs to be installed.# emerge --ask www-client/w3m

Then, enable image preview in ranger's config file, ~/.config/ranger/rc.conf.$ nvim ~/.config/ranger/rc.conf ================================== ... set preview_image true ... set preview_images_method urxvt

Cmus:

Cmus is a small, fast and powerful console music player. # emerge --ask media-sound/cmus

TO DOs: set ups

Scrot:

Scrot is a command line screen capture utility.# emerge --ask media-gfx/scrot

Neofetch:

Neofetch is a bash script that displays the system information such as installed OS, kernel version, CPU, memory, etc... next to an ASCII operating system logo.# emerge --ask app-misc/neofetch

Chromium

Chromium is a free and open-source web browser from Google. It features a minimal user interface, powerful web development tools, and a built in task manager. There is a proprietary version of browser called Google Chrome

with more features than Chromium.# emerge --ask www-client/chromium

Be warned: Compiling Chromium can take a significant amount of CPU time and system memory, and it took nearly 7 hours to complete compiling.

Fonts:

I use following fonts for urxvt and i3.

  • Inconsolata
  • Kochi (for Japanese)
  • Font Awesome (for font icons)
  • Deja Vu
# emerge --ask media-fonts/inconsolata # emerge --ask media-fonts/kochi-substitute # emerge --ask media-fonts/fontawesome # emerge --ask media-fonts/dejavu

That's all!
-gibb

Building My Work Environment (Part 4)

Part 4 - De-Uglifying i3

There are many sites offer themes/themers for i3, like unix121's themer. But I like clean and simple, so I changed just a handful of components.

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

gtk2 Theme

I imported my old gtk2 theme, Morning Glory from Openbox days. This theme can be applied using lxappearance.$ tar -xzvf MorningGlory.tar.gz -C ~/.themes/ ... $ lxappearance

Icons

I still use Faenza icon set. I recently found out that this icon set can be downloaded and installed from slackbuilds.org


Font Awesome Fonts/Icons

i3pystatus I installed in the Part 3 uses icons to display each component, like CPU and memory. For that, font awesome needs to be installed. The latest version at the time of this writing is 5.0.10. Download a zip file, unzip it, and copy otf files from the use-on-desktop folder to system appropriate directory.$ unzip fontawesome-free-5.0.10.zip ... $ cd fontawesome-free-5.0.10/use-on-desktop/ # cp *.otf /usr/share/fonts/OTF # mkfontdir /usr/share/fonts/{TTF,OTF} # mkfontscale /usr/share/fonts/{TTF,OTF} # fc-cache -fv Restart X

To check if the fonts were properly installed, run fc-list:$ fc-list | grep -i awesome ...

Ricty Font

Ricty is Japanese True Type font based on Inconsolata and Circle M+ 1m, optimized for the programming usage. Here is some benefits of using the font:

  • Use Inconsolata for the Latin character glyphs and "Circle M+ 1m" font for other glyphs.
  • Adjust the width of full-width and normal-width character glyphs to 2:1 ratio exactly full and half.
  • Design the comma, period, colon, semicolon and bracket character glyphs to differentiate each other clearly to prevent confusions.
  • Design the high visibility p-sound sign attached Kana character glyphs.
  • Design the En-dash and Em-dash glyphs show them as the broken line to prevent input failures for LaTeX.
  • It shows Em-size space as "box" character because Em-size space often prevents debugging since users usually miss it. With Ricty Diminished font, users can find and fix it easily.

The instruction on how to build Ricty is from this site.

Bash Environment

I changed the style and color of PS1 in .bashrc. PS1='\[\e[38;5;106m\]\A \[\e[38;5;210m\]\u\[\e[38;5;229m\]@\[\e[38;5;220m\]\h\[\e[38;5;252m\][\[\e[38;5;69m\]\w\[\e[38;5;252m\]]\n\[\e[47m\]\[\e[38;5;232m\]$\[\e[00m\] '


=====
~/.bashrc
=====

Color Scheme for ranger

ranger is a text-based file manager with vi/vim key-bindings. Since it's key stroke based, it's perfect for i3. I like my default color scheme. But you can change the color scheme by ~/.config/ranger/colorschemes/.
For syntax highlighting in ranger, I use highlight.


=====
~/.config/ranger/*
=====

Color Scheme for urxvt

The color scheme for urxvt is controlled from .Xresources. I'm currently using gruvbox.

=====
~/.Xresources
=====

rofi

rofi is a window switcher, application launcher, and dmenu replacement, currently maintained by Dave Davenport. It's lightweight and highly customized. My rasi theme file, dark_elements.rasi, and rofi config file are availble.


=====
~/.config/rofi/*
=====

i3lock

I created a bash file to take a screenshot, blur that image, insert a lock icon, and apply it to i3lock.


=====
~/Scripts/i3lock/lock_blur_i3.sh
~/Scripts/i3lock/lock_red.png
=====

In next article, let's talk about displaying Japanese characters in terminal.

That's all!
-gibb

Building My Work Environment (Part 3)

Part 3 - Oh, what's that Window Manager?

Openbox used to be my de facto window manager for my systems for years. You can see some of my posts related to Openbox here. I have nothing but praises for its lightweight and solid performance (Not to mention it's highly customizable).

Then, I learned about Tiling window manager by chance. Tiling WM is designed to arrange windows in a way that they don't overlap each other. Also, it supports key-bindings to operate around keystrokes instead of using a mouse. That reminded me of vi/vim editor. Those facts piqued my interest.

I first started using Awesome Window Manager because it was a tiling window manger but also supported the floating option, which somewhat gave me a peace of mind. Awesome wm was highly configurable from a configuration file written in lua language. I quickly got around and configured it the way I wanted. However, a few months after, I noticed some keybindings stopped working and/or didn't behave the ways they should.

Then, I moved onto i3 window manager. It was next logical thing to try this wm as I read so many positive inputs about it. No regrets. It's easier to configure than Awesome wm because its configuration file is plain text, and it just worked. I've been using it a little more than a few months but I don't think I could go back to Awesome wm or stacking/floating window manager like Openbox ever again!

Disclaimer:
The information in this site is the result of my researches in the Internet and of my experiences. This information below is solely used for my purpose and may not be suitable for others.

Installation:

Installation of i3wm isn't that difficult with Slackware. Go to slackbuilds.org, download all dependencies, and install them one by one.... Installation of dependencies ... $ tar -xzvf i3.tar.gz i3/ i3/slack-desc i3/README i3/i3.SlackBuild i3/i3.info i3/doinst.sh i3/xinitrc.i3 $ mv i3-4.15.tar.bz2 i3/ # cd i3/ # ./i3.SlackBuild ... Slackware package /tmp/i3-4.15-x86_64-1_SBo.tgz created. # installpkg /tmp/i3-4.15-x86_64-1_SBo.tgz ... Executing install script for i3-4.15-x86_64-1_SBo.tgz. Package i3-4.15-x86_64-1_SBo.tgz installed.

At the beginning, I referred i3 like vi/vim. It's just like that. If you know right key combinations, your productivity would increase. But if you are not familiar with it, it's just so hard to deal with. In my humble opinion, although its learning curve is steep, it's worth learning how to properly use it.

To set i3 as your default windows manager, you'd need to run xwmconfig. $ xwmconfig

Config File:

i3's config file is located at ~/.config/i3/config, and it's a plain text file. It should be fairly easy to understand because of all the comments there. One thing you do need to remember is to reload the config file with $Mod+Shift+r each time the file has been modified.
=====
~/.config/i3/config
=====

Status Bar:

By default, i3 does not offer a status bar unless you install one. I tried with i3blocks and configured it with mpd/ncmpcpp support and everything I wanted to show in my status bar on my notebook with Debian stretch; however, to install i3blocks on Slackware, you need to go through ridiculous number of dependencies. For that reason, I gave up on installing i3blocks. Instead, I installed i3pystatus. i3pystatus was so easy to set up and manage it because each piece is a module, and it didn't take me long to configure it as I wanted.

Before i3pystatus can properly display, some python modules need to be installed: $ pip3 install --upgrade pip ... $ pip3 install netifaces \ > psutil \ > colour ... $

The i3pystatus version I downloaded from slackbuilds.org is 3.35. I'm not sure if this problem only applies to this version but when memory usage is displayed with {used_mem}, it displays a negative value. After reading up on different forums, I figured out that its source code for mem.py did not support newer version of psutil. Within the code, to get the value of used memory, it was subtracting cached and buffers values from used value. This was ok for psutil version before 4.4.0. With newer psutil (> 4.4.0), getting the used value itself was good enough, I guess.

To prove my point, this is what's going on: $ python3 >>> import psutil >>> psutil.__version__ '5.4.5' >>> mem = psutil.virtual_memory() svmem(total=...) >>> print(mem.used - mem.cached - mem.buffers) <== This is what's done in the code -311427072 <== Gives a negative value >>> print(mem.used) <== For newer psutil version, this is all you need 301985792

Now, we need to edit the source code to take care of newer version for psutil. 1) Change 2nd line from this:from psutil import virtual_memory to: import psutil 2) On line 45 and 46, there is a piece of code to get used memory. That should be changed from:memory_usage = virtual_memory() used = memory_usage.used - memory_usage.cached - memory_usage.buffers to:memory_usage = psutil.virtual_memory() if psutil.version_info < (4, 4, 0): used = memory_usage.used - memory_usage.cached - memory_usage.buffers else: used = memory_usage.used This should take care of displaying a negative value for used memory in i3pystatus.

=====
~/.config/i3/i3pystatusconf.py
=====

Screen Lock:

I use i3lock to lock the screen. It's simple and customizable.

Shutdown, Reboot, and Logout:

The official way of getting out of i3 is to press $Mod+Shift+e simultaneously. This will show a message bar on top of the screen. Then click on yes, exit i3 to exit. I found this step a bit cumbersome. I could type sudo /sbin/shutdown -h now in a terminal but I'd need to open one if I'm in say web browser workspace. So, I created a i3 mode to handle key combinations to logout, lock screen, reboot, or shutdown (referenced Arch Linux Wiki).

For this to work, sudoer needs to be enabled for a regular user to run the shutdown or reboot command.# visudo ------------------------ [user_name] ALL=NOPASSWD: /sbin/shutdown,/sbin/reboot

In next article, let's talk about changing the look and feel of i3 window manager.

That's all!
-gibb

Installing Arch Linux: LVM on top of an encrypted partition [[UPDATED]]

Years back, I was using Arch Linux on my notebook but gave up at some point after upgrading Arch Linux made my notebook unbootable. After some distro hoppings, I settled down with Debian Linux and it has been my friend since then. But now, out of a whim, I decided to give another try on Arch.

I'll be installing Arch Linux on the same notebook and I wanted the encryption on a disk/partition like before. I looked around some options from the Arch Linux Wiki. I read up on LVM on LUKS, LUKS on LVM, and Plain dm-crypt and decided to go with LVM on LUKS again. One of benefits for LUKS on LVM is that it can have encrypted volumes span multiple disks. It's nice but I don't need it since there is only one disk for the notebook. Plain dm-crypt can encrypt an entire disk and this is nice and ideal but having a USB flash memory around is a bit overkill for me. So, I'll stick with LVM on LUKS again.

I then followed my old post, Installing Arch Linux: LVM on top of an encrypted partition. What do you know? The information on that page was not wrong but was a bit confusing or hard to follow (not to mention about the number of typos. Sheesh!). So, I decided to re-do the whole steps, including the base installation of Arch Linux on LVM. Most of the information here will be duplicates from old one but please bare with me.

Disclaimer:
Information below is gathered mostly from the Arch Linux Wiki page and changed here and there for my liking. This information below is solely used for my purpose and may not be suitable for others.

Erasure of the Hard Disk:

Information (data) on a Hard Drive is written in chunk here and there. Re-partitioning or reformatting a disk does not really removes (erase) the data. It merely remove the system structure that used to identify where the original data was located. This leaves the actual data on a disk.

To securely erase a disk, you could either:

  • Fill with zeros
  • Fill with random bits

Both methods overwrite data on a disk but the first one fill with zero's leaving easily (to some extent) identify where the encrypted data ends. So, I follow the second method. # dd if=/dev/urandom of=/dev/<drive> bs=1M Just to be warned, this takes a long, long time.

Partitioning a Disk:

There is a way to encrypt the /boot partition with GRUB (for details, see Pavel Kogan's blog), but for simplicity, I'll stick with having the /boot partition separated from the encryption and LVM. # fdisk /dev/sda

Partition Layout:
/dev/sda1 -> /boot (bootable) - 300MB should be enough.
/dev/sda2 -> LVM (8e) - the rest of the disk

Configuring LUKS:

cryptsetup is used to interface with LUKS for formatting, mounting and unmounting encrypted partition.

First make sure the device mapper kernel module is installed: # modprobe dm-mod

Then format it as an encrypted LUKS partition: # cryptsetup --cipher aes-xts-plain64 --key-size 512 --hash sha512 luksFormat /dev/sda2

  • --cipher: defines the cipher type
  • --key-size: defines the key size
  • --hash sha512: hash algorithm used for key derivation.

It looks like AES cipher in XTS mode (XTS-AES) is most popular these days.

Unlocking/Mapping LUKS partition with the Device Mapper:

To access the encrypted volume, It needs to be unlocked. # cryptsetup open --type luks /dev/sda2 lvm

LVM:

Create a physical volume (encrypted volume) and a group volume. # lvm pvcreate /dev/mapper/lvm # lvm vgcreate lvmvg /dev/mapper/lvm

Create logical volumes on this new volume group. # lvm lvcreate -L 10G -n root lvmvg # lvm lvcreate -L 500M -n swap lvmvg # lvm lvcreate -l 100%FREE -n home lvmvg

Format the filesystems on each logical volume. # mkfs.ext4 /dev/mapper/lvmvg-root # mkfs.ext4 /dev/mapper/lvmvg-home # mkswap /dev/mapper/lvmvg-swap

Mount the filesystems. # mount /dev/mapper/lvmvg-root /mnt # mkdir /mnt/home # mount /dev/mapper/lvmvg-home /mnt/home # swapon /dev/mapper/lvmvg-swap

Prepare the boot partition. # mkfs.ext2 /dev/sda1 # mkdir /mnt/boot # mount /dev/sda1 /mnt/boot

Configure Wireless Network:

Network connection needs to be configured before the installation can take a place. Since my notebook uses WiFi, I need to configure wireless network.

Check for the network interface and whether udev has loaded the driver. # iwconfig -------------------- eth0 no wireless extensions. lo no wireless extensions. wlan0 IEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=14 dBm Retry long limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:on

It looks like wlan0 is available.

Interface activation:

Not required for mine but here is how to activate # ip link set wlan0 up

Access point discovery:

I know my network information like ESSID, Encryption key, etc..., but here is how to list available access points # iwlist wlan0 scan | less

Or, for the new netlink interface # iw dev wlan0 scan | less

Association to the access point

Now a configuration file, /etc/wpa_supplicant.conf, needs to be created for my access point. # vi /etc/wpa_supplicant.conf -------------------- ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel eapol_version=1 ap_scan=1 fast_reauth=1

These options are explained in /etc/wpa_supplicant/wpa_supplicant.conf

Append the passphrase and PSK to the file # wpa_passphrase SSID_NAME "PASSPHRASE" >> /etc/wpa_supplicant.conf

Manual connection:

The WiFi interface should be up by the earlier command ip link set wlan0 up, so now tell wpa_supplicant the driver (wext - Linux Wireless EXTensions), the SSID specified in /etc/wpa_supplicant.conf and the wireless interface. # wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf

  • -B : Run in the background
  • -D : Driver information. Default is WEXT
  • -i : Wireless interface
  • -c : Configuration file

Request an IP address to DHCP server. # dhcpcd wlan0

Check assigned IP address. # ip addr show wlan0 wlan0: mtu 1500 qdisc mq state UP qlen 1000 link/ether 00:00:00:00:00:00: brb ff:ff:ff:ff:ff:ff inet 192.168.1.6/24 brb 192.168.1.255 scope global wlan0 inet6 fe80::ffff:ffff:ffff:ffff/64 scope link valid_lft forever preferred_lft forever

Select installation mirror:

Before installing, you may want to edit /etc/pacman.d/mirrorlist such that your preferred mirror is first. This copy of the mirrorlist will be installed on your new system by pacstrap as well, so it's worth getting it right.

Install the base system and other package groups:

The base system is installed using the pacstrap script. pacstrap is a script that installs packages to the specified new root directory. If no packages are given, pacstrap defaults to the "base" group.

Required X Window Systems packages for openbox will be installed in post-installation configuration.

The system uses wireless network, so install the required wireless network packages. # pacstrap /mnt base base-devel wireless_tools wpa_supplicant wpa_actiond

Configurations:

Let's configure the primary configuration files.

Generate an fstab file:

The fstab file contains static filesystem information. It defines how storage devices and partitions are to be mounted and integrated into the overall system. It is read by the mount command to determine which options to use when mounting a specific device or partition.

Check the resulting file afterwards, especially watch for the swap entry. # genfstab -p /mnt >> /mnt/etc/fstab # vi /mnt/etc/fstab -------------------- ... /dev/mapper/lvm-swap none swap defaults 0 0

Chroot into the system (Change root into the new system):

# arch-chroot /mnt

Editing /etc/rc.conf:

/etc/rc.conf is the configuration file for Arch's initscripts. Some of options in this file has been obsolete and they now have own configuration files (ex: hostname, etc...). /etc/rc.conf still configures daemons to start during boot-up and some networking and storage information.

Since LVM is used on this system, I need to enable it so that the kernel knows about it.

# vi /etc/rc.conf -------------------- USELVM="yes"

Hostname:

Configuring hostname requires updating two files, /etc/hostname and /etc/hosts

Add hostname in /etc/hostname # cat > /etc/hostname archy64 ^D

Add hostname in /etc/hosts # vi /etc/hosts -------------------- 127.0.0.1 localhost.localdomain localhost archy64 ::1 localhost.localdomain localhost archy64

Console fonts and keymap:

The console, meaning a terminal running with no X Window System, uses the ASCII character set as the default.

A console font is limited to either 256 or 512 characters. The fonts are found in /usr/share/kbd/consolefonts/.

Keymaps, the connection between the key pressed and the character used by the computer, are found in the subdirectories of /usr/share/kbd/keymaps/ # cat > /etc/vconsole.conf KEYMAP=us FONT= FONT_MAP= ^D

  • KEYMAP - the default (us) is ok
  • FONT - the default (blank) is ok
  • FONT_MAP - the default (blank) is ok

Timezone:

Available time zones and subzones can be found in the /usr/share/zoneinfo/<Zone>/<SubZone> directories.

Create a symlink /etc/localtime to zone file. # ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime

Locale:

Choose the locale(s) from /etc/locale.gen and uncomment them. # vi /etc/locale.gen -------------------- en_US.UTF-8 UTF-8 -------------------- # locale-gen

Setting up system-wide locale:

# cat > /etc/locale.conf LANG=en_US.UTF-8 LC_TIME=en_US.UTF-8 ^D

Set the LANG variable for the ramdisk creation # export LANG=en_US.UTF-8

Hardware clock time:

It's recommended to use UTC. # hwclock --systohc --utc

Create an initial ramdisk environment:

Configure /etc/mkinitcpio.conf for encryption and LVM by adding encrypt lvm2 (in this order) in the HOOKS section before filesystems so that the kernel will find LVM volumes at boot time. # vi /etc/mkinitcpio.conf -------------------- HOOKS="...encrypt lvm2 filesystems..."

Now generate the kernel image. # cd /boot # mkinitcpio -p linux

Install and configure a bootloader:

# pacman -S grub-bios os-prober # grub-install --recheck /dev/sda

Create a grub configuration file. # grub-mkconfig --output /boot/grub/grub.cfg

/boot/grub/grub.cfg

Add cryptdevice=/dev/sda2:lvmvg between root=... and ro in the line starts with linux. This needs to be done for "Arch Linux" and "Arch Linux Fallback". # vi /boot/grub/grub.cfg -------------------- linux /boot/vmlinuz-linux root=/dev/mapper/lvmvg-root cryptdevice=/dev/sda2:lvmvg ro quiet

Root password:

Set the root password now. # passwd

Reboot:

Exit from chroot, unmount the partitions, close the device and reboot. # exit # umount -R /mnt/boot # umount -R /mnt # cryptsetup close lvm # reboot

After rebooting, it should ask you for a passphrase like below:

Post-Installation

Updating the system:

Sync, refresh, and upgrade the entire new system. # pacman -Syu (or pacman --sync --refresh --sysupgrade)

Pacman will now download a fresh copy of the master package list from the server(s) defined in /etc/pacman.conf and perform all available upgrades.

Note: If you get following errors after executing above statement, it most likely you don't have dhcpcd is not running or your network setting is not correct.

error: failed retrieving file '...' from ... : Could not resolve host: ...

Pacman output is saved in /var/log/pacman.log

Adding a user:

Now add a normal user account for daily tasks # useradd -m -g users -G audio,games,log,lp,optical,power,scanner,storage,video,wheel -s /bin/bash ubyt3m3

Set a password for ubyt3m3 # passwd ubyt3m3

X Window System:

The X Window System (commonly X11, or X) is a networking and display protocol which provides windowing on bitmap displays. It provides the standard toolkit and protocol to build graphical user interfaces (GUIs).

Before installing the X11, try to see what kind of video card you have # lspci | grep -e VGA -e 3D

Then install the base Xorg packages using pacman. # pacman -S xorg-server xorg-xinit xorg-server-utils

During the installation, it'll ask you for the type of libgl. Use below information based on the type of video card you have (returned value from the lspci command above), choose a proper driver.

AMD/ATI
xf86-video-amdgpu ... mesa-libgl
xf86-video-ati ... mesa-libgl
catalyst ... catalyst-libgl

Intel
xf86-video-intel ... mesa-libgl

Nvidia
xf86-video-nouveau ... mesa-libgl
nvidia ... nvidia-libgl
nvidia-340xx ... nvidia-340xx-libgl
nvidia-304xx ... nvidia-304xx-libgl

Install video driver:

My system came with ATI Graphics Card, so install the open source raden driver. # pacman -S xf86-video-ati

Install input driver:

Since this install is for notebook, following package is needed for touchpad. # pacman -S xf86-input-synaptics

Are you installing Arch Linux as VirtualBox Guest?

If you are like me, you'd test the installation of OS or software on a virtual system before actually installing on main systems. I use VirtualBox for that. In order for Arch Linux to run X11 within the VirtualBox guest environment, VirtualBox Guest Additions need to be installed. # pacman -S virtualbox-guest-utils

After executing above command, it'll ask you for guest modules. Choose virtualbox-guest-modules-arch if you used linux kernel when you ran mkinitcpio -p linux during the configuration period. For other modules, use virtualbox-guest-dkms

Loading the VirtualBox kernel modules:

Before getting X11 work on the guest environment, VirtualBox kernel modules must be loaded. To do this automatically, enable the vboxservice service. # systemctl enable vboxservice

Load the modules # modprobe -a vboxguest vboxsf vboxvideo

Testing X:

Install the default environment. # pacman -S xorg-twm xorg-xclock xterm

Fonts

Install a set of TrueType fonts, as only unscalable bitmap fonts are included by default. DejaVu is a set of high quality. # pacman -S ttf-dejavu

Now, that's a very base system. If you are interested in installing Openbox, you can follow steps in my post, Openbox (w/ Arch Linux).

That's all!
-gibb