How to setup Manjaro Linux i3 on a Macbook Pro
Tags: macbookpro, linux, manjaro, tutorial
Published: 2018-02-12 15:55:21

---
title: How to setup Manjaro Linux i3 on a Macbook Pro
published: true
tags: ["macbookpro", "linux", "manjaro", "tutorial"]
canonical_url: https://lobotuerto.com/blog/how-to-setup-manjaro-linux-i3-on-a-macbook-pro/
cover_image: https://thepracticaldev.s3.amazonaws.com/i/cqxg10yoqlb39pui6uq0.jpg
---

***

You can check the latest updated version of this article at [lobotuerto's notes - How to setup Manjaro Linux i3 on a Macbook Pro.](https://lobotuerto.com/blog/how-to-setup-manjaro-linux-i3-on-a-macbook-pro/)

***


I have laid my eyes on a new distribution that bakes in **i3** with it: [Manjaro Linux i3 Community Edition.](https://manjaro.org/category/community-editions/i3/ "i3 Manjaro Linux")

It has some rough edges, but I’m pretty sure they’ll be ironed out rather sooner than later, given Manjaro’s rise in popularity.

What I can say is that Manjaro Linux feels nimble and agile, meanwhile Ubuntu starts to feel bloated and sluggish.

So, what follows is a _very_ opinionated guide for installing Manjaro Linux on a MacBook Pro from Mid 2014, and leave it in a perfect state for desktop and software development usage —kind of what I currently have in Ubuntu.

Still on the quest for a perfect OS. Let’s start!

# Download

- Direct downloads and checksums: [here.](https://sourceforge.net/projects/manjarolinux-community/files/i3/ "Manjaro Linux direct download and checksums")
- Torrent downloads: [here.](https://sourceforge.net/projects/manjarotorrents/files/community/i3/ "Manjaro Linux torrent downloads")

# Preparing the live USB

You need another Linux machine, or a way to make a Manjaro Linux live USB stick.

Once you have downloaded the **.iso** image you can follow [these instructions](https://lobotuerto.com/blog/how-to-create-an-ubuntu-live-usb-using-the-cli/ "How to create an Ubuntu live USB using the CLI") to prepare the USB drive.

# Booting from USB

Turn off your machine, insert the USB drive, then turn it on, and as you hear the distinctive sound when it starts, press and hold the `alt` key until a boot menu appears. Select the one that says **EFI**.

You’ll be presented with a preconfiguration screen. Select your timezone, keyboard distribution, language, free drivers, then: **Boot: manjaro.x86…**

# Installation

You’ll be presented with a dialog with many buttons, click on the one that says: **Launch installer**.

You might see a couple of _unreadable_ warnings, they usually are about:

- The machine is not connected to a power source.
- The machine is not connected to the Internet.

When you get to **Partitions** select **Erase disk** to get rid of everything on that Mac (don’t worry you’ll always be able to recover OSX if you really want to —but not your data though, so be careful!).

While you are at it, click on the **Encrypt system** checkbox and pick a nice and long passphrase for it, then click through the install wizard and wait for it to be finished with the installation process.

# Configuration

## HighDPI screen

The first thing to do is to improve our ability to read that super small text on the terminal.

Check the supported modes (resolutions) for your screen with:

```
xrandr
```

If the initial DPI is too much for you —it is for me— try a couple of resolutions and see what you feel comfortable with. In my case I usually settle with `1680x1050` or `1400x900`.

Try them out like this:

```
xrandr --output eDP1 --mode 1680x1050
```

To make this permanent, edit `~/.i3/config` and add this line at the end:

```
exec --no-startup-id xrandr --output eDP1 --mode 1680x1050
```

## Keyboard

Second on the list of annoyances is the keyboard, since I like to move fast on my **i3** desktop environment the swapped out keys don’t help, let’s fix that.

Let’s swap the **Alt** and **Cmd** keys out.  
With immediate effect:

```
echo 1 | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd
```

To make it permanent:

```
echo options hid_apple swap_opt_cmd=1 | \
sudo tee -a /etc/modprobe.d/hid_apple.conf
```

Let’s enable function keys (f1, f2, f3…) by default —instead of default multimedia keys.  
With immediate effect:

```
echo 2 | sudo tee /sys/module/hid_apple/parameters/fnmode
```

To make it permanent:

```
echo options hid_apple fnmode=2 | \
sudo tee -a /etc/modprobe.d/hid_apple.conf
```

## GRUB

I usually remove the `quiet` option from grub in `/etc/default/grub`. I like my startup process _noisy._

If you edit the `grub` file, don’t forget to:

```
sudo update-grub
```

## SSD

If you have an SSD, you can activate a periodic TRIM operation that’ll run by default on a weekly basis with:

```
sudo systemctl enable --now fstrim.timer
```

It’s based on the timestamp of: `/var/lib/systemd/timers/stamp-fstrim.timer`.

## UFW

Activate the firewall service at boot with:

```
sudo ufw enable
sudo systemctl enable --now ufw.service
```

## SSH

If you want to allow incoming SSH connections through the firewall, try with this:

```
sudo ufw allow SSH
```

Modify and uncomment the following lines in `/etc/ssh/sshd_config`:

```
PermitRootLogin no
PasswordAuthentication no
```

Enable the SSH service:

```
sudo systemctl enable --now sshd.service
```

If you ever modify the `/etc/ssh/sshd_config` file, restart the SSH service with:

```
sudo systemctl restart sshd.service
```

## WiFi

I solved this by first connecting through an USB-Ethernet adapter cable —[this one](https://www.amazon.com.mx/dp/B00MYTSN18/ref=cm_sw_r_tw_dp_U_x_JiqvAb1YE37YZ "USB 3.0 Gigabit Ethernet") has worked great so far.

First, let’s generate a ranked mirror list, then update the package databases:

```
sudo pacman-mirrors --geoip
sudo pacman -Syy
```

In case you want to tweak it, the list of mirrors can be found here: `/etc/pacman.d/mirrorlist`.

To upgrade your installed packages:

```
sudo pacman -Su
```

Find out which kernel version you have installed with `uname -a`.

Then let’s install the appropriate headers and driver:

```
sudo pacman -S linux-headers broadcom-wl-dkms
```

In my case, I selected the `linux414-headers`.

Let’s restart to try out our configs so far!

You should be able to use **WiFi** now.

If you don’t, and you see something like this in your `journalctl -b` logs:

```
kernel: wl: version magic '4.14.15-1-MANJARO SMP preempt mod_unload modversions retpoline ' should be '4.14.15-1-MANJARO SMP preempt mod_unload modversions '
```

You might be able to force WiFi activation with this:

```
sudo modprobe wl --force-vermagic
```

It worked just fine over here.

## Sound

This came as a surprise, sound is not working out of the box.  
The good news is, it only requires some tweaking and we’ll be good.

Edit this file:

```
sudo nano /etc/modprobe.d/alsa-base.conf
```

And put inside:

```
options snd_hda_intel enable=1 index=0
options snd_hda_intel enable=1 index=1
```

Install `pulseaudio` and `pavucontrol`:

```
sudo pacman -S pulseaudio pavucontrol
```

Also, the mute key works OK for muting, but pressing it again won’t un-mute your sound card, to fix that, add this at the end of you `~/.i3/config`:

```
bindsym XF86AudioMute exec --no-startup-id amixer -D pulse sset Master toggle
```

This one requires a system restart.

After rebooting, you should have sound coming out from your computer, and a working set of multimedia keys.

# Daily usage

## Copy & pasting

You can _paste_ stuff using a 3-finger touch/click on the trackpad.

<!-- TODO: mover esta sección al the perfect linux desktop, dejar este
artículo sólo con cosas particulares a la configuración de la mac,
poner el software setup en el otro -->
# Software

## Utils

```
sudo pacman -S calibre namcap pacaur redshift
```

To execute `redshift` on init, edit `~/.i3/config` and add this line at the end:

```
exec --no-startup-id redshift
```

Don’t know what [redshift is?](http://jonls.dk/redshift/ "Redshift adjusts the color temperature of your screen according to your surroundings")

## File manager

If you miss the cozy space of a file manager, you can get a good one with [Thunar](https://en.wikipedia.org/wiki/Thunar "Thunar is a file manager for Linux and other Unix-like systems"):

```
sudo pacman -S thunar
```

## Browsers

This distro comes with the Pale Moon browser. I tried it out, didn’t like it.  
To get rid of it:

```
sudo pacman -Rs palemoon-bin
rm -rf ~/.moonchild\ productions/
```

If you want to install the other two —Firefox and Google Chrome:

```
sudo pacman -S firefox
pacaur -S google-chrome
```

## Code editor

```
pacaur -S visual-studio-code-bin
```

## Network service discovery

This is useful if you have a network printer:

```
sudo systemctl enable --now avahi-daemon.service
```

Now CUPS should detect it without problems.  
Go to this URL `http://localhost:631`, and add your network printer over there!

# Daily workflow ready?

Definitely **yes!**

# Links

- [ArchWiki – MacBookPro11,x](https://wiki.archlinux.org/index.php/MacBookPro11,x "ArchWiki -- MacBookPro11,x")
- [How to make Alsa pick a preferred sound device automatically?](https://superuser.com/questions/626606/how-to-make-alsa-pick-a-preferred-sound-device-automatically "How to make Alsa pick a preferred sound device automatically?")
- [Visual Studio Code](https://wiki.archlinux.org/index.php/Visual_Studio_Code "Visual Studio Code")