downshiftertech.eu

Describe your website

Email LinkedIn

/* Title: Installing Antergos on a Thinkpad T410 Description: An off-topic article that hopefully makes it to a whole new website Date: 2015/11/27 Category: System administration Keywords: Linux, Antergos, Archlinux, Thinkpad, T410 Template: post_eng */

This article assumes you are not afraid to let go of your mouse and do some typing in the terminal. Everything mentioned in this article worked for me, but make sure you back your system up.

I have been a proud owner of a Lenovo T410 laptop provided by my employer for some time now. It’s a bulky machine, but serves its purpose fairly well. Windows 7, which it came preinstalled with, still works, but everyone knows Windows tends to become slower over time, so did my instance. Now, I do not plan to migrate over to the newer versions, but I was slowly losing my patience, and being a Linux user for about 10 years, I decided to make my machine dual-bootable.

The specs for my machine are as follows:

CPU: Intel M 540
RAM: 4 GB
HDD: 320 GB

As I mentioned earlier, the machine came preinstalled with Windows 7, so the whole hard drive was an NTFS partition. So my initial goal was to shrink the NTFS partition to make room for Linux. In order to do that, I went into the Disk Management utility.

Right-click on the C: drive and select Shrink volume.

Wait a few moments and a dialog will show up offering you to specify how much space you want to free up.

Now, Windows won’t let you free up all of the space available, but it’s Windows after all, your hard drive belongs to it.

The worst part is that it won’t actually let you shrink the volume at all, showing you a big scary warning. I have read some articles on the internet regarding volume shrinking, but apart from suggesting turning off hibernation and a paging file as well as defragmenting the hard drive I could not find a lot of useful information.

This is when I turned to the command line. Fire up cmd.exe and enter DISKPART.

I wanted to shrink my existing partition by 100 GB, so I entered 100 000 as my desired size. Press Enter and go get yourself some coffee. This concludes the Windows part of my tutorial.


And now comes the fun part…

Having lost faith in Ubuntu, which brought me over to the Linux world around 2005, I recently became a fan of rolling-release distros. Archlinux is great, but it requires a lot of tinkering, so my go-to distribution these days is Antergos.

Now, for this project, I chose the 64-bit version, as my T410 has 4GB of RAM. If you have less, you can also use the 32-bit version. Antergos provides you with a great choice of Desktop Environments, but I prefer to squeeze every bit of processing power out of my machinery, so I went with Openbox. I could have also gone with the command-line interface, but the Openbox flavour saves you quite some time by configuring X and some other useful stuff like a network manager, a dock and others.

So go over to Antergos website and make sure you download the Antergos Minimal ISO 64bit. Choose the torrent version to save some bandwidth for the Antergos project. I usually choose the Minimal install, because I mostly don’t need to use the system as a live image. Besides, the great thing about the minimal install is that it always downloads the latest version of the graphical installer, Cnchi.

Update [20.02.2016]: In case you are having troubles where Cnchi is not showing some elements of the window, just close it, open up a terminal window and run Cnchi from the command line.

Now, at the time of writing this, the current version of Antergos is 2015.09.13 which still has a nasty problem with LightDM desktop manager. I tried installing Slim, but as the archwiki page suggests, it is no longer maintained and doesn’t play with systemd very well. So the option I decided to stick with for the time-being is the good old console login followed by either a tmux session or a graphical interface using startx command.

So fire up the Antergos CD and proceed with the installation. Make sure you select Openbox when asked to choose a Desktop Environment. This will make our job easier.

When asked about partitions, select Choose exactly where Antergos should be installed. Select the device titled Free space and press the New button below. Create an extended partition. Then add Swap (mine was 4096 MB at the end of space), /boot (mine was ext2 256 MB in size at the beginning of the space), and, finally / (mine turned out to be 100 GB with ext4 file system).

Also, don’t forget to select Automatic login, although we won’t be needing a login manager anyway.


After the installation

After the system has rebooted, I installed my must-have packages: i3 and tmux. Enter sudo pacman -S i3 tmux

Now, just to be sure if it’s still a problem with LightDM as you’re reading this, log out of the Openbox session and try to login as your user. If your screen turns blank with the backlight still on and/or blinks, that means that LightDM problems haven’t been fixed yet (which was exactly my case). So I decided to have it removed altogether. But before we do that, let’s edit our .xinitrc file.

Type nano .xinitrc and comment out the last line that says exec dbus-launch ... by placing # at the start of the line. Add the following:

DEFAULT_SESSION=openbox-session
case $2 in
	openbox)
		exec dbus-launch --exit-with-session openbox-session ;;
	i3)
		exec dbus-launch --exit-with-session i3 ;;
	*)
		exec dbus-launch --exit-with-session $DEFAULT_SESSION ;;
esac

What we want to do here is make startx take an argument and launch a corresponding windows manager, in our case, either i3 or Openbox.

One final thing to do here is to uninstall the dreadful LightDM, along with its dependencies. To do that, issue the command: sudo pacman -Rcn lightdm It will also remove light-locker, light-locker-settings, lightdm-webkit-theme-antergos, lightdm-webkit-greeter and lightdm itself. Now we can finally reboot our system and try out our new system.


Disabling workspace switching using the mouse wheel

Before we wrap up for today, there is one more thing I would like to mention. As much as I love Openbox, there is one thing that really annoys me: scrolling a mouse wheel on an empty space on the desktop results in switching workspaces. I want to disable this. Unfortunately, I couldn’t find this option anywhere in the graphical settings manager, that means we have to manually edit the configuration file. Open ~/.config/openbox/rc.xml and look for the section that looks like this:

<context name="Desktop">
	<mousebind action="Click" button="Up">
		<action name="DesktopPrevious"/>
	</mousebind>
	<mousebind action="Click" button="Down">
		<action name="DesktopNext"/>
	</mousebind>

And comment it out, so it reads:

	<context name="Desktop">
	<!--
		<mousebind action="Click" button="Up">
			<action name="DesktopPrevious"/>
		</mousebind>
		<mousebind action="Click" button="Down">
			<action name="DesktopNext"/>
		</mousebind>
	-->

Don’t forget to restart or simply reconfigure Openbox from the dropdown menu.

http://crunchbang.org/forums/viewtopic.php?id=35258


Setting up network time

I have noticed that my newly installed Antergos was showing incorrect time. So I went ahead and checked the status of timedatectl with timedatectl status The output was as follows:

      Local time: Thu 2015-10-15 23:32:46 EEST
  Universal time: Thu 2015-10-15 20:32:46 UTC
        RTC time: Thu 2015-10-15 20:32:46
       Time zone: Europe/Tallinn (EEST, +0300)
 Network time on: no
NTP synchronized: no
 RTC in local TZ: no

This meant that, for some reason, Antergos disabled network synchronization although I specifically recall selecting this option during the installation progress. Anyway, this problem was really easy to fix by running: sudo timedatectl set-ntp true Wait a couple of seconds and your system time should be correct, provided you have selected the right location during installation.

https://wiki.archlinux.org/index.php/Systemd-timesyncd


A few notes on languages

I am constantly switching between Russian and Estonian keyboard layouts and my preferred key combination is Alt+Shift In order to enable this, edit .xinitrc once again and add the following line before DEFAULT_SESSION line we added earlier on:

setxkbmap -layout "ee,ru" -option "grp:alt_shift_toggle" &

In case you didn’t remove LightDM login manager, add the previous line to .bashrc instead of .xinitrc.

To set the console font to Estonian instead of English, just edit /etc/vconsole.conf and add KEYMAP=et You also need to do this in case you see errors during system boot, where systemd-vconsole-setup-service fails to start. For some reason, Cnchi installer sets KEYMAP=ee instead of KEYMAP=et in /etc/vconsole.conf file for Estonian keymap, so I had to change it manually.


Disabling the annoying PC speaker beep

sudo nano /etc/modprobe.d/nobeep.conf and add the line blacklist pcspkr


Increasing bash history size

nano .bashrc

export HISTSIZE=10000
export HISTFILESIZE=100000

Outputting to multiple monitors

I am a happy owner of a Thinkpad docking station, so to output my screen content to an external display I created a script that I run whenever I connect my laptop to the docking station. My external display is located right above my laptop, so the script is as follows: nano dock.sh

#!/bin/bash
xrandr --output VGA1 --auto --above LVDS1

To execute it, just run: ./dock.sh

To output the video back to the single laptop display you can also create another script, in my case undock.sh, which contains the following:

#!/bin/bash
xrandr --output VGA1 --auto

Don’t forget to mark both of those files executable with chmod +x dock.sh undock.sh


Adjusting the brightness

I haven’t yet discovered a nice way to control the backlight brightness using the hardware keys, so my best option currently is directly adjusting the brightness form the command line:

sudo tee /sys/class/backlight/intel_backlight/brightness <<< 300

where 300 is the desired brightness level.