Spacemacs, i3, and Manjaro

Tags: spacemacs, manjaro, i3, thinkpad, post

Published on Sunday, May 20th, 2018

After I upgraded my computer to Ubuntu 18.04, I was fed up with how laggy things are, especially for Atom and Gnome Shell. Since all of my finals are over, I decided to try out new things.

Spacemacs

I started by learning Vim, as it loads much faster than Atom. Although I am still not used to the modal editing, I find it very appealing and think it might make my life more productive, so I decided to give it a tryAlthough I find the key j and k very unintuitive. They should be swapped!.

However, Vim is not really extensible, so I tried to find an alternative. Emacs, which I have been using for a while, is an obvious choice, but it is not a modal editor... Except that Emacs is extensible enough to have the evil mode which makes Emacs become a modal editor. I in fact used Spacemacs which has a bunch of packages preinstalled, including the evil mode.

There’s a problem, however. Spacemacs makes Emacs very slow. Fortunately, I found an article that tells me that I have been using Emacs wrong for my whole life: I should set up an emacs server, so that emacs doesn’t need to reload things again when I open a client.

i3 and Manjaro

As mentioned above, I would like to switch from Gnome Shell to something else. As all people in the programming language lab uses a tiling window manager (Jack and Justin use XMonad and Preston uses Sway), I feel compelled to do the same. I decided to use i3 because I feel it doesn’t need to be configured as much as XMonad, and Sway, which uses Wayland, seems to be relatively unstable compared to i3.

Jack has been trying to convince me to install Arch Linux. While I find rolling release great, I really don’t want to set everything up by myself, so Manjaro Linux, which is advertised as “a user-friendly Linux distribution based on ... Arch”, is thus a natural candidate to look at. I find its i3 edition really great because unlike fresh installation of i3, where nothing works (sound keys, brightness keys, etc.), Manjaro i3 edition has everything working out of the box.

Setup

First things first, let’s use the fastest mirror site:

1
2
sudo pacman-mirrors -g
sudo pacman -Syyu

Then, install a sensible terminal. I don’t like urxvt as it doesn’t support things out of the box. I am currently using termite instead.

1
pms termite

Next, set up the directory that contains all git projects and install dotfiles.

1
2
3
4
5
6
7
mkdir ~/git
cd git
git clone git@github.com:sorawee/dotfiles.git
pms racket # need Racket for the dotfiles installer
pms racket-docs # Racket documentation needs to be installed separately
cd dotfiles
racket setup.rkt

As mentioned above, I use Spacemacs as my main editor. Here’s how I set it up:

1
2
3
4
5
pms emacs
git clone -b develop https://github.com/syl20bnr/spacemacs ~/.emacs.d
mkdir ~/emacs
wget http://www.neilvandyke.org/scribble-emacs/scribble.el -O ~/emacs/scribble.el # Scribble mode
emacs # call emacs explicitly to install packages. Don't forget to rebuild epdfview when a dialog appears

I also want to use zsh as my default shell.

1
2
3
4
5
6
7
zsh
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
setopt EXTENDED_GLOB
for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^(README.md|zshrc|zprestorc)(.N); do
  ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
done
chsh -s /bin/zsh

We need to restart the computer to make it take effect. Next, install a bunch of programs:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
pms firefox # firefox, cause I don't like pale moon
pms yay     # yay
pms glipper # clipboard manager
pms polybar # alternative top bar
pms mpd     # needed by polybar to work correctly
pms xf86-input-wacom # so that wacom works

# fonts
pms adobe-source-code-pro-fonts # for Spacemacs and polybar
pms ttf-font-awesome # for polybar
yay -S nerd-fonts-complete # for polybar
yay -S ttf-th-sarabun-new # Thai font

pms rofi    # use rofi instead of dmenu
pms evince  # for a PDF viewer that has "print to file"
pms aspell-en # fix Spacemacs' error
pms npm # Pyret stuff
sudo npm install -g tern # fix Spacemacs' error
pms xournal # xournal
pms gimp    # gimp
pms liferea # feed reader
pms playerctl # so that we can play/pause and next/previous
pms jdk10-openjdk # for Alloy development
pms eclipse-java # for Alloy development
yay -S slack-desktop # Slack
pms gnome-common # dependency for iio-sensor-proxy
yay -S iio-sensor-proxy # for accelerometer
pms texlive-most # TeX
pms pass # Password Manager
pms xorg-xwininfo # for ~/bin/i3-get-window-criteria
yay -S peek # GIF recorder
yay -S skypeforlinux-stable-bin # Skype
yay -S spotify # Spotify

# web development
pms postgresql
yay -S heroku-cli # webapp stuff
pms chromium # a webkit browser


# my blog
raco pkg install pollen
raco pkg install libuuid

# fingerprint reader
yay -S libfprint-vfs0090-git
pms fprintd

sudo apt install adobe-flashplugin
sudo apt install redshift redshift-gtk
sudo apt install dropbox

I want to install goldendict along with the dictionaries as usual:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
pms goldendict
mkdir ~/dict
cd ~/dict
wget http://ftp.psu.ac.th/pub/stardict/stardict-lexitron-et-2.4.2.tar.bz2
wget http://ftp.psu.ac.th/pub/stardict/stardict-lexitron-te-2.4.2.tar.bz2
tar -xf stardict-lexitron-et-2.4.2.tar.bz2
tar -xf stardict-lexitron-te-2.4.2.tar.bz2
# thanks to http://jsomers.net/blog/dictionary and
# eduardosanchez.me/2015/09/07/installing-websters-revised-unabridged-dictionary-on-ubuntu-gnulinux/
wget https://s3.amazonaws.com/jsomers/dictionary.zip
unzip dictionary.zip
cd dictionary
tar -xf stardict-dictd-web1913-2.4.2.tar.bz2
mv stardict-dictd-web1913-2.4.2 ~/dict
cd ~/dict
rm -rf dictionary *.tar.bz2
# also need to add ~/dict as a directory to search for dictionaries
# *recursively* in goldendict

Slack and Skype work very well without any additional configuration.

Last but not least, Thinkpad tweaking!

1
2
yay -S thinkpad-yoga-scripts-git
e -n /opt/thinkpad-yoga-scripts/rotate/thinkpad-rotate.py

Set both disable_touchpads and rotate_pens to True. Then:

1
2
systemctl enable yoga-rotate@$USER.service --now
systemctl enable yoga-backlight.service --now

FIN