sudo apt install .\/sur5r-keyring_2024.03.04_all.deb<\/code><\/pre>\n\n\n\nInstall the repository;<\/p>\n\n\n\n
echo \"deb http:\/\/debian.sur5r.net\/i3\/ $(lsb_release -sc) universe\" | sudo tee \/etc\/apt\/sources.list.d\/sur5r-i3.list<\/code><\/pre>\n\n\n\nRun system package cache update;<\/p>\n\n\n\n
sudo apt update<\/code><\/pre>\n\n\n\nInstall i3;<\/p>\n\n\n\n
sudo apt install i3<\/code><\/pre>\n\n\n\nConfiguring i3 Windows Manager on Ubuntu 22.04<\/h3>\n\n\n\n Once the installation is done, you can now proceed to configure i3-wm on Ubuntu 22.04.<\/p>\n\n\n\n
First, log out of your system and log in again. While logging in, be sure to select i3 session at your login screen.<\/p>\n\n\n
\n
<\/figure><\/div>\n\n\nUpon successfully logging in, you are then prompted on whether to:<\/p>\n\n\n\n
\nauto-generate an i3-wm configuration file, ~\/.config\/i3\/config<\/strong><\/code> or<\/li>\n\n\n\nsimply use the default configuration file.<\/li>\n<\/ul>\n\n\n\n
<\/figure><\/div>\n\n\nIn this setup, we will go with the first option of having to auto generate the i3-wm configuration file. We will later modify it to suit our needs. Therefore, press ENTER<\/strong> and continue.<\/p>\n\n\n\nNext, you need to define the i3-wm modifier key ($mod<\/code><\/strong>). You have two options here: you can use the Windows logo key<\/strong><\/code> or the Alt key<\/strong><\/code>. In this setup, we will use the popular $mod key, the Windows logo key<\/code><\/em> as our i3-wm modifier, and is selected by default. Use the arrow up or down keys to select the $mod<\/strong> keys.<\/p>\n\n\n\n
<\/figure><\/div>\n\n\nWrite the changes by pressing ENTER<\/strong>.<\/p>\n\n\n\nAnd you should now be welcomed by black screen with some status bar at the bottom that resembles the one shown in the screenshot below;<\/p>\n\n\n\n <\/figure>\n\n\n\nBasic Usage of i3<\/h3>\n\n\n\n Now that it is installed with the basic configuration setup, there are a few key combinations that can be used to perform some basic tasks;<\/p>\n\n\n\n
Note that $mod represents the modifier key you selected. Either Alt or Win key. It is Win key on our setup<\/strong>.<\/p>\n\n\n\n\nOpen a terminal: $mod + ENTER<\/strong><\/code>.<\/li>\n\n\n\nLaunching system applications via the dmenu: $mod + d<\/code><\/strong>. This opens up a menu at the top of the screen where you can put keywords to search for specific app.<\/li>\n\n\n\nEnter a fullscreen mode on and off: $mod + f<\/strong><\/code>.<\/li>\n\n\n\nClosing an application window; $mod + Shift + q<\/strong><\/code><\/li>\n\n\n\nRestarting i3: $mod + Shift + r<\/strong><\/code>.<\/li>\n\n\n\nExiting i3 windows manager: $mod + Shift + e<\/strong><\/code>.<\/li>\n<\/ul>\n\n\n\nCustomizing i3 on Ubuntu 22.04<\/h3>\n\n\n\n Next, we want to make i3 appealing and easy to use. You can customize i3-wm by modifying the ~\/.config\/i3\/config<\/strong><\/code> file.<\/p>\n\n\n\nBelow is our sample i3 wm configuration;<\/p>\n\n\n\n
cat ~\/.config\/i3\/config<\/code><\/pre>\n\n\n\n# Please see http:\/\/i3wm.org\/docs\/userguide.html for a complete reference!\n#\n\nset_from_resource $darkred color1 #000000\nset_from_resource $red color9 #000000\nset_from_resource $darkgreen color2 #000000\nset_from_resource $green color10 #000000\nset_from_resource $darkyellow color3 #000000\nset_from_resource $yellow color11 #000000\nset_from_resource $darkblue color4 #000000\nset_from_resource $blue color12 #000000\nset_from_resource $darkmagenta color5 #000000\nset_from_resource $magenta color13 #000000\nset_from_resource $darkcyan color6 #000000\nset_from_resource $cyan color14 #000000\nset_from_resource $darkwhite color7 #000000\nset_from_resource $white color15 #000000\n\n# Use custom colors for black\n set $black #282828\n set $darkblack #1d2021\n set $transparent #00000000\n\nset $mod Mod4\nset $mod1 Mod1\nset $terminator terminator\n\n\n# Font for window titles. Will also be used by the bar unless a different font\n# is used in the bar {} block below.\nfont pango:monospace 12\n\n# This font is widely installed, provides lots of unicode glyphs, right-to-left\n# text rendering and scalability on retina\/hidpi displays (thanks to pango).\n\nfont pango:DejaVu Sans Mono 12\n#font pango:Meslo LG L Regular Nerd Font Complete 15\n\n# Use Mouse+$mod to drag floating windows to their wanted position\nfloating_modifier $mod\n\n# start a terminator by pressing Mod key + x or ENTER\nbindsym $mod+Return exec $terminator\nbindsym $mod+x exec $terminator\n\n# Custom bindsyms\nbindsym $mod+p exec ~\/.config\/i3\/bin\/logout\nbindsym $mod+l exec i3lock -i \/home\/kifarunix\/Pictures\/linuxtux.png\nbindsym $mod+c exec google-chrome\nbindsym $mod+r mode \"resize\"\nbindsym $mod+Shift+f exec \/home\/kifarunix\/.config\/i3\/bin\/rofifinder\n\n\n# Enable Print Screen\n#bindsym --release $mod+Print exec gnome-screenshot -i\nbindsym --release $mod+Print exec shutter -s\n\n# kill focused window\nbindsym $mod+q kill\n\n# start dmenu (a program launcher)\nbindsym $mod+d exec --no-startup-id ~\/.config\/i3\/bin\/rofi_app_launcher\n\n\n# change focus\nbindsym $mod+j focus left\nbindsym $mod+k focus down\n# bindsym $mod+l focus up\nbindsym $mod+semicolon focus right\n\n# alternatively, you can use the cursor keys:\nbindsym $mod+Left focus left\nbindsym $mod+Down focus down\nbindsym $mod+Up focus up\nbindsym $mod+Right focus right\n\n# move focused window\nbindsym $mod+Shift+j move left\nbindsym $mod+Shift+k move down\nbindsym $mod+Shift+l move up\nbindsym $mod+Shift+semicolon move right\n\n# alternatively, you can use the cursor keys:\nbindsym $mod+Shift+Left move left\nbindsym $mod+Shift+Down move down\nbindsym $mod+Shift+Up move up\nbindsym $mod+Shift+Right move right\n\n\n# split in horizontal orientation\nbindsym $mod+h split h\n\n# split in vertical orientation\nbindsym $mod+v split v\n\n# enter fullscreen mode for the focused container\nbindsym $mod+f fullscreen toggle\n\n# change container layout (stacked, tabbed, toggle split)\nbindsym $mod+s layout stacking\n#bindsym $mod+w layout tabbed\nbindsym $mod+t layout tabbed\nbindsym $mod+e layout toggle split\n\n# toggle tiling \/ floating\nbindsym $mod+Shift+space floating toggle\n\n# change focus between tiling \/ floating windows\nbindsym $mod+space focus mode_toggle\n\n# focus the parent container\nbindsym $mod+a focus parent\n# focus the child container\nbindsym $mod+z focus child\n\n# Workspace Variables\nset $ws1 \"1:<\/i> \"\n#set $ws2 \"2:<\/i> \"\nset $ws2 \"2:<\/i> \"\nset $ws3 \"3:<\/i> \"\nset $ws4 \"4:<\/i> \"\nset $ws5 \"5:<\/i> \"\nset $ws6 \"6:<\/i>\"\nset $ws7 \"7:<\/i>\"\nset $ws8 \"8:<\/i> \"\nset $ws9 \"9:<\/i> \"\n\n\n# switch to workspace\nbindsym $mod+1 workspace $ws1\nbindsym $mod+2 workspace $ws2\nbindsym $mod+3 workspace $ws3\nbindsym $mod+4 workspace $ws4\nbindsym $mod+5 workspace $ws5\nbindsym $mod+6 workspace $ws6\nbindsym $mod+7 workspace $ws7\nbindsym $mod+8 workspace $ws8\nbindsym $mod+9 workspace $ws9\nbindsym $mod+0 workspace $ws10\n\n# move focused container to workspace\nbindsym $mod+Shift+1 move container to workspace $ws1\nbindsym $mod+Shift+2 move container to workspace $ws2\nbindsym $mod+Shift+3 move container to workspace $ws3\nbindsym $mod+Shift+4 move container to workspace $ws4\nbindsym $mod+Shift+5 move container to workspace $ws5\nbindsym $mod+Shift+6 move container to workspace $ws6\nbindsym $mod+Shift+7 move container to workspace $ws7\nbindsym $mod+Shift+8 move container to workspace $ws8\nbindsym $mod+Shift+9 move container to workspace $ws9\nbindsym $mod+Shift+0 move container to workspace $ws10\n\n# reload the configuration file\nbindsym $mod+Shift+c reload\n# restart i3 inplace\nbindsym $mod+Shift+r restart\n# exit i3 (logs you out of your X session)\nbindsym $mod+Shift+e 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'\"\n\n# resize window (you can also use the mouse for that)\nmode \"resize\" {\n # These bindings trigger as soon as you enter the resize mode\n\n # Pressing left will shrink the window\u2019s width.\n # Pressing right will grow the window\u2019s width.\n # Pressing up will shrink the window\u2019s height.\n # Pressing down will grow the window\u2019s height.\n bindsym j resize shrink width 10 px or 10 ppt\n bindsym k resize grow height 10 px or 10 ppt\n bindsym l resize shrink height 10 px or 10 ppt\n bindsym semicolon resize grow width 10 px or 10 ppt\n\n # same bindings, but for the arrow keys\n bindsym Left resize shrink width 10 px or 10 ppt\n bindsym Up resize grow height 10 px or 10 ppt\n bindsym Down resize shrink height 10 px or 10 ppt\n bindsym Right resize grow width 10 px or 10 ppt\n\n # back to normal: Enter or Escape\n bindsym Return mode \"default\"\n bindsym Escape mode \"default\"\n}\n#\n# Pulse Audio controls\n# run pactl list sinks\n#bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume\n#bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume#\n#bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 1 toggle # mute sound\n\n# Amixer\n\nbindsym XF86AudioRaiseVolume exec --no-startup-id amixer -D pulse sset Master 5%+ #increase sound volume\nbindsym XF86AudioLowerVolume exec --no-startup-id amixer -D pulse sset Master 5%- #decrease sound volume#\nbindsym XF86AudioMute exec --no-startup-id amixer -q set Master toggle # mute sound\n\n# Sreen brightness controls\n# enable passwordless sudo for ybacklight. echo \"kifarunix ALL=NOPASSWD: \/usr\/bin\/ybacklight\" > \/etc\/sudoers.d\/ybacklight\nbindsym XF86MonBrightnessUp exec sudo ybacklight -inc 5 # increase screen brightness\nbindsym XF86MonBrightnessDown exec sudo ybacklight -dec 5 # decrease screen brightness\n\n# i3blocks\nbar {\n status_command i3blocks\n position top\n font pango:Hack, FontAwesome 11\n\n colors {\n separator #081419\n background #253941\n #statusline #839496\n focused_workspace #fdf6e3 #6c71c4 #fdf6e3\n active_workspace #fdf6e3 #6c71c4 #fdf6e3\n inactive_workspace #002b36 #586e75 #002b36\n urgent_workspace #d33682 #d33682 #fdf6e3\n\n statusline $white\n separator $transparent\n }\n}\n\n\nset $m1 #808080 \nset $m2 #FFF0E0\n\n# Startup programs\nexec --no-startup-id dunst \nexec_always compton &;\nexec --no-startup-id clipit &; \nexec_always feh --bg-scale \/home\/kifarunix\/Pictures\/linux-wallpaper.jpg\nexec_always --no-startup-id nm-applet\n\n\n# Bind App to workspace\n# Check class by using xprop command\nassign [class=\"chromium\"] $ws2\nassign [class=\"Firefox\"] $ws2\nassign [class=\"Atom\"] $ws3\nassign [class=\"Foxit Reader\"] $ws3\nassign [class=\"Pcmanfm\"] $ws4\nassign [class=\"VirtualBox\"] $ws5\nassign [class=\"Virt-manager\"] $ws5\nassign [class=\"Skype\"] $ws6\nassign [class=\"mpv\"] $ws9\nassign [class=\"vlc\"] $ws9\nassign [class=\"Thunderbird\"] $ws7\nassign [class=\"(?i)libreoffice-startcenter\"] $ws8\nassign [class=\"(?i)soffice\"] $ws8\nassign [class=\"(?i)libreoffice\"] $ws8\n\n\n# Assign to certain workspace\nassign [window_role=\"browser\"] $ws2\n\n# Press $mod+o followed by either f, s, l, m, v, k, d, t, Esc or Return {ENTER),\n# to launch FoxiReader, Skype, lxappearance, thunderbird, VirtualBox,\n# KVM Virt-manager, spectacle, pcmanfm file manager, \n# or return to the default mode, respectively.\nset $mode_launcher Launcher\nbindsym $mod+o mode \"$mode_launcher\"\n\nmode \"$mode_launcher\" {\n bindsym f exec FoxitReader \n bindsym s exec skypeforlinux\n bindsym l exec lxappearance \n bindsym m exec thunderbird \n bindsym v exec VirtualBox \n bindsym k exec virt-manager \n bindsym d exec spectacle \n bindsym t exec \"pcmanfm \/home\/kifarunix\"\n\n bindsym Esc mode \"default\"\n bindsym Return mode \"default\"\n}\n\n# Shutdown, Reboot, Lock Screen, and Logout \n\nset $power_mode \"power\"\nbindsym $mod+Shift+q mode $power_mode\nmode $power_mode {\n bindsym p exec systemctl poweroff\n bindsym r exec systemctl reboot \n bindsym l exec i3lock -i \/home\/kifarunix\/Pictures\/linuxtux.png, mode \"default\"\n bindsym q exec --no-startup-id i3-msg exit, mode \"default\"\n bindsym h exec sudo systemctl hibernate \n bindsym s exec sudo systemctl suspend\n bindsym Return mode \"default\"\n bindsym Escape mode \"default\"\n}\n\n# Floating windows\nfor_window [window_role=\"task_dialog|bubble|page-info|Preferences|pop-up\"] floating enable\nfor_window [window_role=\"Open Files\"] floating enable sticky\nfor_window [window_role=\"File Operation Progress\"] floating enable sticky\nfor_window [class=\"qBittorrent\" window_role=\"pop-up\"] floating enable\nfor_window [window_type=\"dialog\"] floating enable\nfor_window [window_type=\"menu\"] floating enable\n\n# Sticky window\nfor_window [instance=\"file_progress\"] sticky enable\nfor_window [class=\"info|Mate-color-select|gcolor2|timesup|QtPass|GtkFileChooserDialog\"] sticky enable\n\n# Focus window settings\nno_focus [window_role=\"pop-up\"]\nfocus_on_window_activation focus\n<\/code><\/pre>\n\n\n\n The above configuration gives us such a window;<\/p>\n\n\n\n <\/figure>\n\n\n\nTo use our config above, make a backup of the default configuration and paste the contents above into config file.<\/strong><\/p>\n\n\n\nWhat is needed for the above?<\/h3>\n\n\n\nInstall Requires packages<\/h4>\n\n\n\n A number of packages are requires for the above display and various shortcuts defined in the configuration file above;<\/p>\n\n\n\n
sudo apt install feh \\\n fonts-font-awesome \\\n rofi \\\n pulseaudio-utils \\\n xbacklight \\\n alsa-tools \\\n clipit \\\n gcc \\\n git \\\n terminator \\\n locate \\\n pcmanfm \\\n acpi \\\n libnotify-bin \\\n htop \\\n shutter \\\n iw \\\n mlocate \\\n gnome-screenshot\n<\/code><\/pre>\n\n\n\nUpdate mlocate database;<\/p>\n\n\n\n
sudo updatedb<\/code><\/pre>\n\n\n\nInstall ybacklight for controlling the screen brightness if xbacklight doesn’t work;<\/p>\n\n\n\n
git clone https:\/\/github.com\/szekelyszilv\/ybacklight.git\ncd ybacklight\/src\nsudo gcc ybacklight.c -o \/usr\/bin\/ybacklight<\/code><\/pre>\n\n\n\nThis may not work on some systems. Therefore, install these additional packages;<\/p>\n\n\n\n
sudo apt install brightnessctl<\/code><\/pre>\n\n\n\nInstall i3 Logout Script<\/h4>\n\n\n\n As defined the i3 configuration above, log out script, which gives such an logout interface shown below upon pressing $mod+p<\/code><\/strong> key combination, is installed under, ~\/.config\/i3\/bin\/logout<\/strong><\/code>.<\/p>\n\n\n