Manjaro Setup on Thinkpad

dimanche 2 décembre 2018 • GF

This is my custom checklist for a clean install and setup of Arch/Manjaro Gnome 3 desktop on Lenovo Thinkpad (X1 Carbon, X270, X280).

Before Install

Power on the computer and press Enter key to enter BIOS menu. Enter BIOS setup (F1 or F2).

In Security, disable Secure Boot.

In Keyboard, switch Fn behavior: F1=F1, Fn+F1=utility.

Install

Arch

Manjaro

For the installation itself: boot from the Manjaro ISO, click on the installer icon on the dock, spam-click ‘next’…

The Manjaro ISO is periodically re-generated but it’s unlikely your system will be up to date after a fresh install. The last step of the install process is therefore to update the installed system.

sudo pacman -Syyu

The build essentials might not be all installed. This is pretty easy to fix:

sudo pacman -S base-devel

One of the strenghts of Arch and Manjaro is the AUR. Yaourt is one of the best wrappers to install softwares from the AUR.

sudo pacman -S yaourt

Configure Hardware

Screen

The X1 Carbon Thinkpad has a HiDPI WQHD screen. Gnome default 100% pixel scaling makes the texts unreadable and the interface elements difficult to click on. However, with the default 200% scale used by Manjaro everything look big, too big. I find a 150% fractional scaling to be the best compromise. The setup is easy with xrandr, see HiDPI on Gnome desktop.

CPU Microcode

The Linux kernel can update the CPU microcode when manufacturers release a new version. In order to enable update at boot time:

sudo pacman -S intel-ucode
sudo grub-mkconfig -o /boot/grub/grub.cfg

Touchpad

Enable Natural Scrolling in Settings > Mouse & Touchpad.

Battery

Kernel modules

ThinkPad battery require tp_smapi and acpi_call kernel modules.

First, check your kernel version:

$ uname -a
Linux X1 4.19.4-1-MANJARO #1 SMP PREEMPT Fri Nov 23 18:23:26 UTC 2018 x86_64 GNU/Linux

I’m using a 4.19 kernel. I have to install ‘linux419-‘ modules.

yaourt tp_smapi
yaourt acpi_call

sudo reboot

TLP ui

TLPui is a graphical tool to configure TLP (and avoid miconfiguration):

sudo pacman -S tlpui

CPU frequency scaling

Following ArchWiki, in /etc/tmpfiles.d/energy_performance_preference.conf, add this line:

w /sys/devices/system/cpu/cpufreq/policy?/energy_performance_preference - - - - balance_power

Audio power saving

To shut down the audio card after 1 second of inactivity, add the following line in /etc/modprobe.d/audio_powersave.conf:

options snd_hda_intel power_save=1

Configure Desktop

Theme & Colors

Manjaro is green. I hate green. Let’s replace that ugly green with a nice blue. And let’s use a dark theme… I see a green Manjaro and I want it painted black! No colors anymore, I want them to turn black!

sudo pacman -S arc-solid-gtk-theme

Change it in gnome_tweak_tools (Windows key + tweaks). Use the same app to change Dash to Dock settings (e.g. window counter indicator color, opacity, intellihide, etc.).

Remove animations to speed up everything (Gnome Tweaks > General > Animations).

Hide top bar

There’s an app for that, called… Hide Top Bar (yes, really).

Use gnome-tweak-tool to configure it:

  • Check Show panel when mouse approaches edge of the screen
  • Uncheck Only hide when a window takes the space

Install Apps

Apps to install:

  • Google Chrome: yaourt -S google-chrome
  • Dropbox (see below): yaout -S dropbox nautilus-dropbox
  • 1password: as a Firefox/Chrome extension (now working on Linux !)
  • GitHub Desktop: yaourt -S github-desktop
  • Sublime Text: yaourt -S sublime-text-dev
  • Emacs: sudo pacman -S emacs
  • LaTeX: sudo pacman -S texlive-most
  • Pandoc (documents converter): sudo pacman -S pandoc
  • Nerd Fonts: yaourt -S nerd-fonts-complete
  • Guake or Terminator (terminal): sudo pacman -S guake terminator
  • VLC : pacman -S vlc
  • GPaste (clipboard manager): sudo pacman -S gpaste

Git over SSH

Generate a new SSH key

ssh-keygen
cat ~/.ssh/id_rsa.pub

Copy it and add it in GitHub, Bitbucket, Gitlab, etc.

Setup git identity:

git config --global user.name <username>
git config --global user.email <usermail>
git config --global core.editor gedit

Add some colors. Paste this in ~/.gitconfig :

[color]
  diff = auto
  status = auto
  branch = auto
  interactive = auto
  ui = true
  pager = true

Add SSH key to remote servers

If you want to SSH to remote servers, add your key with this command:

ssh-copy-id <server address>

Dropbox

If you have a lot of files in your dropbox, the filesystem can’t handle them all by default and the sync will halt. This issue can be fixed with the following commands :

su -c "echo 'fs.inotify.max_user_watches = 100000' >> /etc/sysctl.d/99-sysctl.conf"
sudo sysctl --system

Terminator

To use Terminator as a dropdown (Guake-like):

  • Setup a shortcut to show/hide the window (right click > Preferences > Keybindings > full_screen, set F12, restart the app (Ctrl-Shift-Q).
  • Find the right size/position for your screen, e.g. terminator --geometry 1549x400+51+0
  • Create a startup script in ~/.config/autostart/terminator.dekstop:
[Desktop Entry]
Name=Terminator
GenericName=Terminator
Comment=Launch Terminator
Exec=$HOME/.config/autostart/terminator.sh
Terminal=false
Type=Application
X-GNOME-Autostart-enabled=true
  • Create a startup script in ~/.config/autostart/terminator.sh:
#! /bin/bash
sleep 5
terminator --geometry 1549x400+51+0

This is the only way to get the proper geometry: the sleep 5 prevents this script from being executed before the HiDPI script.

Or just use Guake…

LibreOffice

Tools > Options (or Alt-F12), and then:

  • LibreOffice > View > Icon style > Sifr Dark
  • Libreoffice > Application Colors…
Document background: #404552 or #383c4a
Text/Object/Table boundaries: #7c818c
Font color: #bfbfbf
Shadows: uncheck

  • View > Toolbars > unckeck all
  • Right-click on rigt sidebar and undock it.

Some other options:

  • Language settins > Languages > Locale setting: your language if not english (for spellchecking)
  • LibreOffice > Use Data: your data
  • LibreOffice Writer > Formatting Aids > Direct Cursor (free cursor, WordPerfect like)

Sublime Text & Merge

Install – instructions here:

curl -O https://download.sublimetext.com/sublimehq-pub.gpg && sudo pacman-key --add sublimehq-pub.gpg && sudo pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | sudo tee -a /etc/pacman.conf
sudo pacman -Syu sublime-text
sudo pacman -Syu sublime-merge
  • Enter Licence
  • Tools > Install package control
  • Shift-Ctrl-P > Package control: install package…
Git
GitGutter
Ayu
SidebarEnhancements
BracketHighlighter
ColorPicker
Color Highlighter
MarkdownEditing
MarkdownPreview
MarkdownTOC
  • Set theme: Shift-Ctrl-P > Ayu

Dracula Color Theme

Dracula Color Theme

For gedit:

wget https://raw.githubusercontent.com/dracula/gedit/master/dracula.xml
mkdir -p $HOME/.local/share/gedit/styles/
mv dracula.xml $HOME/.local/share/gedit/styles/

For Gnome terminal:

First, create a new default profile in the Terminal (Edit > Preferences).

git clone https://github.com/GalaticStryder/gnome-terminal-colors-dracula
cd gnome-terminal-colors-dracula
./install.sh

GPaste

Change the default keyboard shortcut from Ctrl-Alt-G to Ctrl-Alt-V in Gnome settings: Windows key > Settings > Devices > Keyboard.

iCloud Calendar

Source: Using iCloud calendars on GNU/Linux. Here’s how to setup iCloud calendar on Gnome desktop :

  • Install Evolution
  • Create an app-specific password in iCloud
  • Add a new calendar in Evolution
Address: https://caldav.icloud.com

Finishing

  • Change Wallpaper
  • Connect online accounts (Gnome Settings).