Setting up i3

In this section, we will be dealing with setting up i3 on Fedora. By the end of it, you will have a working version of Fedora + i3 with some preset configurations.

Install Dependencies

To install all the dependecies of i3 run the following command in a terminal:

sudo dnf install polkit-gnome
systemctl enable --now polkit
sudo dnf install NetworkManager network-manager-applet i3 rofi xrandr flameshot i3status i3lock
systemctl enable --now NetworkManager

Here rofi is used to make an app launcher for you. You can launch apps by hitting a keybind (similar to finder on Mac's :D). xrandr is used to determine what your main monitor and how you can arrange displays. flameshot is used to take screenshots. polkit-gnome is used to make a GUI to enter your super user password.

Preset Config

Copy the following config over to ~/.config/i3/config by making the directories as required. Remember ~/.config/i3 is the directory and config is just the file under ~/.config/i3.

# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#

# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!

set $mod Mod4
set $termcmd gnome-terminal 
set $browsercmd firefox 
set $screenshotcmd flameshot gui
set $monitor "exec xrandr | grep primary | awk -F ' ' '{print $1}'"

# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
# font pango:FiraCode NerdFont 10

# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
font pango:DejaVu Sans Mono 8
# font pango:DejaVu Sans Mono 0

# Start XDG autostart .desktop files using dex. See also
# https://wiki.archlinux.org/index.php/XDG_Autostart
exec --no-startup-id dex-autostart --autostart --environment i3

# The combination of xss-lock, nm-applet and pactl is a popular choice, so
# they are included here as an example. Modify as you see fit.

# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
# screen before suspend. Use loginctl lock-session to lock your screen.
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork

# NetworkManager is the most popular way to manage wireless networks on Linux,
# and nm-applet is a desktop environment-independent system tray GUI for it.
exec --no-startup-id nm-applet

# Use pactl to adjust volume in PulseAudio.
set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# move tiling windows via drag & drop by left-clicking into the title bar,
# or left-clicking anywhere into the window while holding the floating modifier.
# tiling_drag modifier titlebar

# start a terminal
bindsym $mod+Return exec $termcmd

# kill focused window
bindsym $mod+q kill

# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right

# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right

# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
bindsym $mod+Ctrl+h split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+Ctrl+f  fullscreen toggle
bindsym $mod+Shift+f floating toggle

# change container layout (stacked, tabbed, toggle split)
bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

# change focus between tiling / floating windows
bindsym $mod+space focus mode_toggle

# focus the parent container
bindsym $mod+a focus parent

# focus the child container
#bindsym $mod+d focus child

# Define names for default workspaces for which we configure key bindings later on.
# We use variables to avoid repeating the names in multiple places.
set $ws1 "1"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8"
set $ws9 "9"
workspace $ws1 output $monitor 
workspace $ws2 output $monitor 
workspace $ws3 output $monitor 
workspace $ws4 output $monitor 
workspace $ws5 output $monitor 
workspace $ws6 output $monitor 
workspace $ws7 output $monitor 
workspace $ws8 output $monitor 
workspace $ws9 output $monitor 

# switch to workspace
bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9

# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9

# reload the configuration file
bindsym $mod+Shift+c reload
#Shift restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+q exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"

# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindsym h resize shrink width 10 px or 10 ppt
        bindsym j resize grow height 10 px or 10 ppt
        bindsym k resize shrink height 10 px or 10 ppt
        bindsym l resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape or $mod+r
        bindsym Return mode "default"
        bindsym Escape mode "default"
        bindsym $mod+r mode "default"
}

bindsym $mod+r mode "resize"

# Remove window borders
for_window [class="^.*"] border pixel 0
# default_border pixel 0
# default_floating_border pixel 0

# Default layout setting
workspace_layout tabbed 

# Window gaps
gaps inner 6

# Titlebar colors
# client.focused #5E81AC #5E81AC #ECEFF4 #5E81AC
client.focused #5E81AC #5E81AC #5E81AC #5E81AC

# Disable focus follow mouse
focus_follows_mouse no

# Custom binds
bindsym $mod+b exec $browsercmd
bindsym $mod+Shift+s exec $screenshotcmd
bindsym $mod+p exec rofi -show drun
for_window [class="Minecraft\* 1.16.1"] floating enable
for_window [class="ninjabrainbot-Main"] floating enable
for_window [title="Windowed Projector \(Scene\) - Mag"] floating enable, resize set width 1, resize set height 1, move position 0 0
for_window [title="Windowed Projector \(Scene\) - Wall"] floating enable, resize set width 1920, resize set height 1080, move position 0 0 
focus_on_window_activation focus

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
bar {
     position top
     tray_output $monitor
     status_command i3status
     colors {
         background #000000
         statusline #ECEFF4

         focused_workspace  #ECEFF4 #5E81AC
         active_workspace   #ECEFF4 #333333
         inactive_workspace #888888 #222222
         urgent_workspace   #ECEFF4 #900000
     }
}
exec /usr/libexec/polkit-gnome-authentication-agent-1 & eval $(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)

Rofi Config

If you absolutely hate the light theme on rofi, you can copy the following contents into ~/.config/rofi/config.rasi and make the directories as required.

/**
 * User: deadguy
 * Copyright: deadguy
 */

@theme "/dev/null"
configuration {
	display-drun:    "Activate";
	display-run:     "Execute";
	show-icons:           true;	
        icon-theme:      "Papirus";
	sidebar-mode:    true;
}

* {
	background-color:            rgb(18, 30, 37);
	text-color:                  #d3d7cf;
	selbg:                       rgb(0, 86, 136);
	actbg:                       rgb(22, 37, 46);
	urgbg:                       #e53935;
	winbg:			     #26c6da;

	selected-normal-foreground:  @winbg;
	normal-foreground:           @text-color;
	selected-normal-background:  @actbg;
	normal-background:           @background-color;

	selected-urgent-foreground:  @background-color;
	urgent-foreground:           @text-color;
	selected-urgent-background:  @urgbg;
	urgent-background:           @background-color;

	selected-active-foreground:  @winbg;
	active-foreground:           @text-color;
	selected-active-background:  @actbg;
	active-background:           @selbg;

	line-margin:                 2;
	line-padding:                2;
	separator-style:             "none";
	hide-scrollbar:              "true";
	margin:                      0px;
	padding:                     0px;
	font:            "Fira Code Nerd Font 10";
}

window {
	x-offset: 0px;
	margin-right: 60px;
	height: 650px;
	orientation: horizontal;
	children:	 [mainbox];
}

mainbox {
	spacing:  0em;
	padding: 0px;
	width:150px;
	children: [ inputbar, listview, sidebar ];
	expand: true;
}

button { padding: 5px 2px; }

button selected {
	background-color: @active-background;
	text-color:       @background-color;
}

inputbar {
     children: [ entry ];
}

textbox-prompt-colon {                                                
     text-color: inherit;                                              
     expand: false;                                                    
     margin: 0 0.3em 0em 0em;
 }  

listview {
	spacing: 0em;
	dynamic: true;
	cycle:   true;
}

element { 
	padding: 16px;
	border:  0 0 0 5px solid;
}

entry {
	expand:         true;
	text-color:     @normal-foreground;
	background-color: rgb(25, 41, 51);
	vertical-align: 1;
	padding:        12px;
	font:            "Hack Nerd Font 13";
}

element normal.normal {
	background-color: @normal-background;
	text-color:       @normal-foreground;
}

element normal.urgent {
	background-color: @urgent-background;
	text-color:       @urgent-foreground;
}

element normal.active {
	background-color: @active-background;
	text-color:       @active-foreground;
}

element selected.normal {
	background-color: @selected-normal-background;
	text-color:       @selected-normal-foreground;
	padding: 16px;
	border:           0 0 0 5px solid;
	border-color:	    @active-background;
}

element selected.urgent {
	background-color: @selected-urgent-background;
	text-color:       @selected-urgent-foreground;
}

element selected.active {
	background-color: @selected-active-background;
	text-color:       @selected-active-foreground;
}

element alternate.normal {
	background-color: @normal-background;
	text-color:       @normal-foreground;
}

element alternate.urgent {
	background-color: @urgent-background;
	text-color:       @urgent-foreground;
}

element alternate.active {
	background-color: @active-background;
	text-color:       @active-foreground;
}

Logging into i3

  • First logout of your current (GNOME) session.
  • In the login screen, look for a cog icon on the bottom right corner.
  • Click on it and choose the i3 option in it.
  • Now you can login with your password and you will be put into the i3 session.

Keybinds

These are the list of basic keybinds in i3:

  • Windows + Enter -> Opens Terminal.
  • Windows + P -> Opens app launcher (rofi). You can launch any other apps from there.
  • Windows + <number> -> Switch to Virtual Desktop <number>.
  • Windows + Shift + <number> -> Move the current window to Virtual Desktop <number>.
  • Windows + W -> Make all windows in the current Virtual Desktop maximized.
  • Windows + Shift + F -> Toggle the current window to be floating.
  • Windows + Drag (Left Click) -> Move the window under cursor around.
  • Windows + Drag (Right Click) -> Resize the window under cursor.
  • Windows + Shift + Q -> Logout of i3. Must be done to shutdown or restart the PC.
  • Windows + Shift + C -> Reload the config file of i3.
  • Windows + Shift + R -> Reload the complete i3 session.

Other QoL Stuff

You can also install arandr using the command sudo dnf install autorandr in a terminal. This is a GUI frontend for xrandr which you can launch from the app launcher and you can arrange your connected displays as you want. Your primary display is the one that is underlined in the GUI there.

Congratulations! You have now setup i3! Now you can do boat eye without any hitches :D.