Since I have been asked quiet frequently about my Linux desktop setup, I decided to write about it. Do not expect this blog post to be a nicely written article. Instead, expect a collection of settings and tweaks that I use to create a comfortable Linux desktop environment.

Please note, that this post is work in progress and will be updated over time.

Hardware

I recently purchased the Lenovo Thinkpad X1 Carbon 6th gen. Read more about it here: /posts/2018-03-12-thinkpadx1c6/.

Other than this nice laptop, I have an external SAMSUNG UHD monitor and that’s about it.

Software

Linux distribution

Currently, I am running Fedora 27 on my Thinkpad X1, because it runs reliably on this very new hardware.

Desktop environment

My default desktop environment is the awesome i3 tiling window manager (https://i3wm.org/). It is a very stable product, allowing to work mainly with shortcuts. It ships a good default configuration, which does not require much tweaking for me. Thanks to its minimalistic approach, the GPU is always at ease. This leads to quiet fans and great battery life (much better compared to more feature rich environments, such as GNOME or KDE, etc.).

You can read more about my i3 setup here.

IBus (Intelligent Input Bus)

I need to switch the keyboard layout regularly. This is done best by utilizing IBUS. This is all you need to do in order to use it:

  • install it: dnf install ibus-setup
  • configure it to run under i3: exec --no-startup-id ibus-daemon --daemonize

After you re-login to your i3, you will notice a system tray. Right click it to configure keyboard layouts, shortcuts, etc.

External screen

Using i3, you will be doomed to make use of xrandr to configure screens. Because I am lazy, I chose the very cool arandr graphical front-end for xrandr instead. It allows to configure your screen with different resolutions, layouts, etc. much like macOS or MS Windows.

arandr output

A neat feature of arandr is, that it allows you to save the configured screen layout. I did this with two layouts, screen-default and screen-home:

$ ls ~/.screenlayout/
screen-default.sh  screen-home.sh

By default, arandr suggests to save your layouts in your $HOME path, which is exactly what I did. arandr saves your xrandr configurations in ready-to-execute scripts. I use those scripts to configure my screen settings depending on my work environment (default means that I use the laptop screen only, home means that I have my SAMSUND UHD monitor attached to my laptop.. you get the idea). When I leave home and disconnect the external screen, I execute ~/.screenlayout/screen-default.sh.

Using this approach, I have a small number of scripts ready to configure my screen every-time exactly the same way I want.

An example configuration (internal screen is default screen & external screen [via HDMI] is configured to be “above” default screen) generated by arandr:

$ cat ~/.screenlayout/screen-home.sh
#!/bin/sh
xrandr --output HDMI-2 --off --output HDMI-1 --mode None --pos 0x0 --rotate \
normal --output DP-1 --off --output eDP-1 --primary --mode 2560x1440 --pos \
448x2160 --rotate normal --output DP-2 --off

WXHD (high dpi)

The Thinkpad X1C6 comes with a display resolution of 2560 x 1440 pixels. It looks really nice, but renders fonts, UI elements, etc. too small for my old eyes.

To solve this issue, I need to configure DPI settings of X11 (i3 uses pretty much all functionality of X11 instead of re-implementing it, like many other desktop environments):

cat ~/.Xresources
Xft.dpi: 140 # default is 220, which is too small

Other than that, I only needed to configure two other tools: Thunderbird and VirtualBox.

Using Thunderbird, install the No Small Text addon and configure the minimum font size.

With VirtualBox, I had no trouble with the GUI, but the guest VMs interface. All I needed to do is configure the Scale Factor via VM window -> View -> Scale Factor -> 125%.

Input

I prefer tap-to-click with the Trackpad. Tap-to-click can be enabled as following:

xinput list # list input devices
xinput list-props "SynPS/2 Synaptics Touchpad" # list trackpad input options
xinput set-prop "SynPS/2 Synaptics TouchPad" "libinput Tapping Enabled" 1 # set trackpad tap to click input option

Power management

For power management and battery life optimization, I use powertop to create a tuned profile:

dnf install tuned-utils
powertop2tuned new_profile_name
tuned-adm profile new_profile_name
systemctl enable tuned
systemctl start tuned

By the way, I always use powertop with all options enabled (--enable), even if not recommended. I did this (USB auto suspend, etc.) for the last ten years, without experiencing stability issues. However, use this flag at your own risk. You have been warned :wink:.

For further power management settings, I use the xfce4-power-manager:

  • install it: dnf install xfce4-power-manager
  • configure i3: exec --no-startup-id /usr/bin/xfce4-power-manager
  • configure xfce4-power-manager via system tray

Network management

For network management, I use network manager, which is shipped by default on Fedora and many other distributions. I access network manager through nm-applet:

  • configure i3: exec --no-startup-id /usr/bin/nm-applet
  • configure network through nm-applet system tray

Screen lock

To lock the screen on i3, I use i3lock:

  • install the package: dnf install i3lock

  • configure i3: bindsum $mod+l exec /usr/bin/i3lock -c 000000

    • using this configuration, I can lock my screen with SUPER+l, just like Windows users lock their screens
  • In order to have a locked screen on resume from suspend, I use the following systemd configuration (don’t forget to set User= to your username):

    [Service]
    User=USERNAME
    Type=forking
    Environment=DISPLAY=:0
    ExecStart=/usr/bin/i3lock -c 000000
    
    [Install]
    WantedBy=sleep.target
    
  • Enable the configuration: systemctl enable i3lock

.bashrc

tbd