Saturday, November 21, 2015

Xubuntu with i3 Tiling Windows Walkthrough

Also look up Manjaro i3. Manjaro is an Arch Linux distro.
See the Lubuntu version of this here.

The idea of this setup is to achieve the best of both worlds from convenient desktop features and essential i3 features. This walkthrough assumes that you are already familiar with using i3, but you do not have to be in order to complete it. An altered default i3 config file is part of the walkthrough, which adapts default i3 keystrokes to XFCE components. (New and replaced sections of the config file are designated in the file.)




  • Use the familiar i3 keystrokes and config file for window tiling.
  • Utilize normal application names instead of binaries'. (dmenu still available)
  • Desktop notifications/indicators (not typically easy to find for i3)
  • Fixes the administrator authentication problem when using i3 in Ubuntu.
    • Software Center
    • Updater
    • Users and Groups
  • Elegant color scheme and icons


As usual, i3 is brought to you by the letter i and by the number 3 . . . and by Dexter.

For this guide, you will need to enter terminal commands, but you should not expect to remember them. Conversely, you will always want to understand the i3 config file. The last step will be to create a link to the i3 configuration file on you XFCE panel - to provide a visual reminder that it is central to your user experience, and conveniently available to open and edit.

The i3 site provides the best source about editing the configuration file.


I. Install Xubuntu on your system

Install the Xubuntu desktop in another Ubuntu variant by entering the following in a terminal:






(The general idea of this walkthrough should work for XFCE and Mint XFCE as well.)

 

 II. Create a Spare User

Especially if you are already using Xubuntu, creating a spare user account ensures that you can easily return to Xubuntu's default desktop.
  1. Open 'Users and Groups'
  2. Click button: 'Add'
  3. Type in your current admin password
  4. Enter a Name title
  5. Enter the official username
  6. Click button: 'OK'
  7. Enter the new user's password
  8. Click button: 'OK'
  9. Click 'Change...', next to 'Account type'
  10. Change the account type to 'Administrator
  11. Click button: 'OK'
  12. Click button: 'Close'
  13. Log out
  14. Select the Xubuntu desktop 
  15. Log in to the new user





III. Install a new background image manager

Xubuntu's desktop settings manager will not work with this setup, but luckily you can install "nitrogen" to change background images. Only remove xfdesktop4 if you (Unfortunately wallch does not work with i3.)






Nitrogen is simple and plays well with i3. It has the ability to set different wallpapers for different monitors or to expand one wallpaper between them.

  1. Open Nitrogen.
  2. Click "Preferences"
  3. Click "Add"
  4. Add any folders you use for background images
    • /usr/share/backgrounds
    • /usr/share/xfce4/backdrop






IV. Install the i3 Window Manager

Enter the following in a terminal to install the i3 window manager:











V. Install i3ipc-GLib and i3 Workspaces Plugin

This is a prerequisite for being able to switch between i3 workspaces in XFCE.


Open a terminal and enter the following:

(The details of this source are found here.)
  • Installing individual sources like this should be done rarely. There is a slight security risk, and it can slow down apt updates 



 


This wonderful plugin allows you to place an i3-compatible workstation switcher on your XFCE panel.

Open a terminal and enter the following:

(The details of this source are found here.)
  • Installing individual sources like this should be done rarely. There is a slight security risk, and it can slow down apt updates








VI. Deactivate Xubuntu's window manager


  1. Open 'Session and Startup', and go to the 'Session' tab.
  2. Note xfwm4 and xfdesktop. These processes will be replaced by the i3 Window Manager.
  3. For xfwm4, click 'Immediately' and change it to the  'Never' option.
  4. For xfdesktop, click 'Immediately' and change it to the 'Never' option.
  5. Click the button: 'Save Session'.
  6. Go to the 'Application Autostart' tab to activate the i3 window manager in the next stage.

Note that you leave the xfce4-panel and Xfsettingsd as they are.










VII. Activate the i3 window manager

  1.  In the 'Session and Startup' window, make sure you are in the 'Application Autostart' tab.
  2. Click the button 'Add' to add i3 to the list of startup applications.
  3. Fill out the form:
    • Name: i3 (or whatever you want to call i3)
    • Description: Tiling Window Manager (or whatever you want)
    • Command: i3 (must be "i3", as below)
  4. Click the button: OK
  5. You should scroll down to the bottom of the list and verify that i3 is listed and checked.
    • (Yes, the intimidating terminal command to start i3 is . . . i3.)
  6. Click the button: Close








VIII. Remove non-i3 Keyboard Shortcuts

Disabling the shortcuts here is about letting i3 take over in this regard, utilizing the i3 config file. Although my general philosophy is to avoid getting technical wherever possible (ie: avoid using a config file when a GUI is available), managing keyboard shortcuts through the i3 config file is inevitable if you want to use i3 at all. For the sake of peace-of-mind, as well as avoiding strange conflicts, I say avoid using 2 different applications for managing keyboard shortcuts. In this guide, ALL keyboard shortcuts are defined by the i3 config, rather than some here and some there. bleh.

  1. Open the 'Keyboard' dialogue.
  2. Go to the 'Application Shortcuts' tab as above.
  3. Remove all keyboard shortcuts
    • You can shift-select all of them and click the button: 'Remove
  4. Click the button: Close









IX. Paste i3 config

Let's get down to brass tacks and just do this thing.
  1. Create a directory in your user's home directory named '.i3'
    • The file path will be like: /home/<yourusername>/.i3/
  2. Create a new file in the .i3 directory named 'config'
    • the file path will be like: /home/<yourusername>/.i3/config
  3. Open the config file in a text editor and save the following in the file:



The i3 site provides the best source for editing the configuration file.





Here is the magic moment when you can restart your computer and log in with i3 as your window manager.



i3 cheat sheet

The mod key is the 'super key', also called the 'windows key' (left of the space-bar.)

mod+Enter opens a terminal
mod+d opens Xubuntu's whisker menu (in place of the dmenu)
mod+Shift+d opens the dmenu
mod+Shift+q closes the current window tile
mod+r initiates resize-tile mode
mod+1, mod+2, etc. (1-0) switches to a different workspace
mod+Shift+1, mod+Shift+2, etc. (1-0) moves the current window tile to a different workspace
mod+Shift+` (` is left of '1') Moves a window tile to the scratch-pad workspace
mod+` Reveals/hides the scratch-pad workspace
mod+Shift+e initiates Xubuntu's session logout dialogue










X. Configure the XFCE Panel


  1. Right-click the XFCE Panel at the top of the screen.
  2. Select the menu option 'Panel >' and then 'Panel Preferences'
    • The panel preferences dialogue should open
    • This looks different in Xubuntu 16.04.
  3. Click on the plus button to add the i3 workspaces plugin you installed earlier.
  4. Use the arrows to place the i3 workspaces plugin where you want it on the panel.
  5. Click the gear button, and configure the i3 workspaces plugin with colors that will show up on the panel.
    • I like to incorporate the i3 window color, which is #285577
  6. Remove the 'Window Buttons' from the panel items by selecting it and clicking the minus button.
  7. You can change the icon on the 'Whisker Menu' so that it is not an infantile mouse icon.
  8. Add or remove any application launchers to the panel.






XI. Create a launcher for i3's config file

  1. In the XFCE Panel items list, add a launcher next to the clock in order to create convenient access to the i3 config file.
  2. Edit the launcher details to be as below
    • Click the icon to change it. (The icon above is included with xubuntu-desktop)
    • Name: i3 Config
    • Command: mousepad config
    • Working Directory: /home/<yourusername>/.i3

The i3 site provides the best source about editing the configuration file.