{"id":20127,"date":"2024-02-08T20:50:01","date_gmt":"2024-02-08T17:50:01","guid":{"rendered":"https:\/\/kifarunix.com\/?p=20127"},"modified":"2024-03-10T16:01:25","modified_gmt":"2024-03-10T13:01:25","slug":"install-i3-windows-manager-on-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-i3-windows-manager-on-ubuntu-24-04\/","title":{"rendered":"Install i3 Windows Manager on Ubuntu 24.04"},"content":{"rendered":"\n<p>Welcome to our tutorial on how to install i3 windows manager on Ubuntu 24.04. i3 is a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Tiling_window_manager\" target=\"_blank\" rel=\"noreferrer noopener\">tiling window manager<\/a> for X11. <em>&#8220;A&nbsp;<strong>tiling window manager<\/strong>&nbsp;is a&nbsp;window manager&nbsp;with an organization of the screen into mutually non-overlapping frames, as opposed to the more popular approach of coordinate-based stacking of overlapping objects (windows) that tries to fully emulate the&nbsp;desktop metaphor.&#8221;<\/em><\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#installing-i-3-windows-manager-on-ubuntu-24-04\">Installing i3 Windows Manager on Ubuntu 24.04<\/a><ul><li><a href=\"#run-system-update\">Run System Update<\/a><\/li><li><a href=\"#install-i-3-windows-manager\">Install i3 Windows Manager<\/a><\/li><li><a href=\"#configuring-i-3-windows-manager-on-ubuntu-24-04\">Configuring i3 Windows Manager on Ubuntu 24.04<\/a><ul><li><a href=\"#login-with-i-3-wm-session\">Login with i3 WM Session<\/a><\/li><li><a href=\"#generate-or-use-default-i-3-wm-configuration\">Generate or use Default i3 WM Configuration<\/a><\/li><li><a href=\"#define-i-3-wm-modifier-key\">Define i3 WM Modifier Key<\/a><\/li><\/ul><\/li><li><a href=\"#basic-usage-of-i-3\">Basic Usage of i3<\/a><\/li><li><a href=\"#customizing-i-3-on-ubuntu-24-04\">Customizing i3 on Ubuntu 24.04<\/a><\/li><li><a href=\"#what-is-needed-for-the-customization-above\">What is needed for the Customization above<\/a><ul><li><a href=\"#install-requires-packages\">Install Requires packages<\/a><\/li><li><a href=\"#install-i-3-logout-script\">Install i3 Logout Script<\/a><\/li><li><a href=\"#search-and-locate-files-using-rofi\">Search and Locate Files using Rofi<\/a><\/li><li><a href=\"#launching-system-apps-using-rofi\">Launching System Apps using Rofi<\/a><\/li><li><a href=\"#other-customizations\">Other customizations;<\/a><\/li><li><a href=\"#set-i-3-wallpaper\">Set i3 Wallpaper<\/a><\/li><li><a href=\"#configure-i-3-blocks\">Configure i3blocks<\/a><\/li><\/ul><\/li><li><a href=\"#further-reading\">Further Reading<\/a><\/li><li><a href=\"#other-tutorials\">Other Tutorials<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installing-i-3-windows-manager-on-ubuntu-24-04\">Installing i3 Windows Manager on Ubuntu 24.04<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"run-system-update\">Run System Update<\/h3>\n\n\n\n<p>To begin with, run system package update.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-i-3-windows-manager\"><a href=\"#install-i3-on-ubuntu-22.04\">Install i3 Windows Manager<\/a><\/h3>\n\n\n\n<p>i3 windows manager can be installed via the <code>i3<\/code> package which is available on the default Ubuntu 24.04 repos.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt show i3<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>Package: i3\nVersion: 4.23-1\nPriority: optional\nSection: universe\/x11\nSource: i3-wm\nOrigin: Ubuntu\nMaintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>\nOriginal-Maintainer: Debian i3 maintainers <team+i3@tracker.debian.org>\nBugs: https:\/\/bugs.launchpad.net\/ubuntu\/+filebug\nInstalled-Size: 10.2 kB\nDepends: i3-wm (= 4.23-1)\nRecommends: i3lock, suckless-tools, dunst\nHomepage: https:\/\/i3wm.org\/\nDownload-Size: 2,042 B\nAPT-Sources: http:\/\/de.archive.ubuntu.com\/ubuntu noble\/universe amd64 Packages\nDescription: metapackage (i3 window manager, screen locker, menu, statusbar)\n This metapackage installs the i3 window manager (i3-wm), the i3lock screen\n locker, i3status (for system information) and suckless-tools (for dmenu).\n These are all the tools you need to use the i3 window manager efficiently.\n<\/code><\/pre>\n\n\n\n<p>There are other tools that are needed to use the i3 window manager efficiently. These include;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>i3 window manager<\/strong><\/code>: The i3-wm itself<\/li>\n\n\n\n<li><code><strong>i3lock<\/strong><\/code> screen locker<\/li>\n\n\n\n<li><code><strong>i3status<\/strong><\/code> for system information<\/li>\n\n\n\n<li><strong><code>suckless-tools<\/code><\/strong> for dmenu<\/li>\n<\/ul>\n\n\n\n<p>These packages are installed along with the i3 meta package.<\/p>\n\n\n\n<p>The default Ubuntu 24.04 repositories provides the latest release version of i3-wm. You can install it by running the command below;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install i3<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"configuring-i-3-windows-manager-on-ubuntu-24-04\">Configuring i3 Windows Manager on Ubuntu 24.04<\/h3>\n\n\n\n<p>Once the installation is done, you can now proceed to configure i3-wm on Ubuntu 24.04.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"login-with-i-3-wm-session\">Login with i3 WM Session<\/h4>\n\n\n\n<p>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<p>So, click the username to get the password prompt. You will then see the login settings gear icon.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;uploadedSrc&quot;:&quot;https:\\\/\\\/kifarunix.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/choose-i3-wm-on-login-screen.png&quot;,&quot;figureClassNames&quot;:&quot;aligncenter size-full&quot;,&quot;figureStyles&quot;:null,&quot;imgClassNames&quot;:&quot;wp-image-20130&quot;,&quot;imgStyles&quot;:null,&quot;targetWidth&quot;:1527,&quot;targetHeight&quot;:856,&quot;scaleAttr&quot;:false,&quot;ariaLabel&quot;:&quot;Enlarge image: Install i3 Windows Manager on Ubuntu 24.04&quot;,&quot;alt&quot;:&quot;Install i3 Windows Manager on Ubuntu 24.04&quot;}\" data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1527\" height=\"856\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/choose-i3-wm-on-login-screen.png?v=1707414218\" alt=\"Install i3 Windows Manager on Ubuntu 24.04\" class=\"wp-image-20130\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/choose-i3-wm-on-login-screen.png?v=1707414218 1527w, https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/choose-i3-wm-on-login-screen-768x431.png?v=1707414218 768w\" sizes=\"(max-width: 1527px) 100vw, 1527px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge image: Install i3 Windows Manager on Ubuntu 24.04\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"context.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"context.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"generate-or-use-default-i-3-wm-configuration\">Generate or use Default i3 WM Configuration<\/h4>\n\n\n\n<p>Upon successfully logging in, you are then prompted on whether to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>auto-generate an i3-wm configuration file, <code><strong>~\/.config\/i3\/config<\/strong><\/code> or<\/li>\n\n\n\n<li>simply use the default configuration file.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;uploadedSrc&quot;:&quot;https:\\\/\\\/kifarunix.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/i3-wm-first-configuration.png&quot;,&quot;figureClassNames&quot;:&quot;aligncenter size-full&quot;,&quot;figureStyles&quot;:null,&quot;imgClassNames&quot;:&quot;wp-image-20131&quot;,&quot;imgStyles&quot;:null,&quot;targetWidth&quot;:1718,&quot;targetHeight&quot;:871,&quot;scaleAttr&quot;:false,&quot;ariaLabel&quot;:&quot;Enlarge image&quot;,&quot;alt&quot;:&quot;&quot;}\" data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1718\" height=\"871\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/i3-wm-first-configuration.png?v=1707414261\" alt=\"\" class=\"wp-image-20131\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/i3-wm-first-configuration.png?v=1707414261 1718w, https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/i3-wm-first-configuration-768x389.png?v=1707414261 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/i3-wm-first-configuration-1536x779.png?v=1707414261 1536w\" sizes=\"(max-width: 1718px) 100vw, 1718px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge image\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"context.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"context.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div>\n\n\n<p>In this setup, we will go with the first option to auto generate the i3-wm configuration file. We will later modify it to suit our needs. Therefore, press <strong>ENTER<\/strong> to continue.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"define-i-3-wm-modifier-key\">Define i3 WM Modifier Key<\/h4>\n\n\n\n<p>Next, you need to define the i3-wm modifier key (<strong><code>$mod<\/code><\/strong>). You have two options here: you can use the <code><strong>Windows&nbsp;logo&nbsp;key<\/strong><\/code> or the<code><strong> Alt key<\/strong><\/code>.<\/p>\n\n\n\n<p>In this setup, we will use the popular $mod key, the&nbsp;<em><code>Windows&nbsp;logo&nbsp;key<\/code><\/em> as our i3-wm modifier, and is selected by default. Use the arrow up or down keys to select the <strong>$mod<\/strong> keys.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure data-wp-context=\"{&quot;uploadedSrc&quot;:&quot;https:\\\/\\\/kifarunix.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/i3-choose-modifier.png&quot;,&quot;figureClassNames&quot;:&quot;aligncenter size-full&quot;,&quot;figureStyles&quot;:null,&quot;imgClassNames&quot;:&quot;wp-image-20132&quot;,&quot;imgStyles&quot;:null,&quot;targetWidth&quot;:1717,&quot;targetHeight&quot;:845,&quot;scaleAttr&quot;:false,&quot;ariaLabel&quot;:&quot;Enlarge image&quot;,&quot;alt&quot;:&quot;&quot;}\" data-wp-interactive=\"core\/image\" class=\"aligncenter size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1717\" height=\"845\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/i3-choose-modifier.png?v=1707414337\" alt=\"\" class=\"wp-image-20132\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/i3-choose-modifier.png?v=1707414337 1717w, https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/i3-choose-modifier-768x378.png?v=1707414337 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2024\/02\/i3-choose-modifier-1536x756.png?v=1707414337 1536w\" sizes=\"(max-width: 1717px) 100vw, 1717px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge image\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"context.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"context.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure><\/div>\n\n\n<p>Write the changes by pressing <strong>ENTER<\/strong>.<\/p>\n\n\n\n<p>And 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 class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1912\" height=\"243\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/i3-wm-default-status-bar.png\" alt=\"\" class=\"wp-image-7044\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/i3-wm-default-status-bar.png?v=1601229441 1912w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/i3-wm-default-status-bar-768x98.png?v=1601229441 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/i3-wm-default-status-bar-1536x195.png?v=1601229441 1536w\" sizes=\"(max-width: 1912px) 100vw, 1912px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"basic-usage-of-i-3\">Basic Usage of i3<\/h3>\n\n\n\n<p>Now that i3WM 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<p>Note that <strong><code>$mod<\/code><\/strong> represents the modifier key you selected. Either Alt or Win key. <strong>It is Win key on our setup<\/strong>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open a terminal: <code><strong>$mod + ENTER<\/strong><\/code>.<\/li>\n\n\n\n<li>Launching system applications via the dmenu: <strong><code>$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\n<li>Enter a fullscreen&nbsp;mode on and off: <code><strong>$mod + f<\/strong><\/code>.<\/li>\n\n\n\n<li>Closing an application window; <code><strong>$mod + Shift + q<\/strong><\/code><\/li>\n\n\n\n<li>Restarting i3: <code><strong>$mod + Shift + r<\/strong><\/code>.<\/li>\n\n\n\n<li>Exiting i3 windows manager: <code><strong>$mod + Shift + e<\/strong><\/code>.<\/li>\n\n\n\n<li>Opening terminal with default config: <strong>$mod + ENTER<\/strong>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"customizing-i-3-on-ubuntu-24-04\">Customizing i3 on Ubuntu 24.04<\/h3>\n\n\n\n<p>Next, we want to make i3 appealing and easy to use. You can customize i3-wm by modifying the <code><strong>~\/.config\/i3\/config<\/strong><\/code> file.<\/p>\n\n\n\n<p>Below is the default configs;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code># This file has been auto-generated by i3-config-wizard(1).\n# It will not be overwritten, so edit it as you like.\n#\n# Should you change your keyboard layout some time, delete\n# this file and re-run i3-config-wizard(1).\n#\n\n# i3 config file (v4)\n#\n# Please see https:\/\/i3wm.org\/docs\/userguide.html for a complete reference!\n\nset $mod Mod4\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 8\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#font pango:DejaVu Sans Mono 8\n\n# Start XDG autostart .desktop files using dex. See also\n# https:\/\/wiki.archlinux.org\/index.php\/XDG_Autostart\nexec --no-startup-id dex --autostart --environment i3\n\n# The combination of xss-lock, nm-applet and pactl is a popular choice, so\n# they are included here as an example. Modify as you see fit.\n\n# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the\n# screen before suspend. Use loginctl lock-session to lock your screen.\nexec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork\n\n# NetworkManager is the most popular way to manage wireless networks on Linux,\n# and nm-applet is a desktop environment-independent system tray GUI for it.\nexec --no-startup-id nm-applet\n\n# Use pactl to adjust volume in PulseAudio.\nset $refresh_i3status killall -SIGUSR1 i3status\nbindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status\nbindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status\nbindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status\nbindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status\n\n# Use Mouse+$mod to drag floating windows to their wanted position\nfloating_modifier $mod\n\n# move tiling windows via drag & drop by left-clicking into the title bar,\n# or left-clicking anywhere into the window while holding the floating modifier.\ntiling_drag modifier titlebar\n\n# start a terminal\nbindsym $mod+Return exec i3-sensible-terminal\n\n# kill focused window\nbindsym $mod+Shift+q kill\n\n# start dmenu (a program launcher)\nbindsym $mod+d exec --no-startup-id dmenu_run\n# A more modern dmenu replacement is rofi:\n# bindcode $mod+40 exec \"rofi -modi drun,run -show drun\"\n# There also is i3-dmenu-desktop which only displays applications shipping a\n# .desktop file. It is a wrapper around dmenu, so you need that installed.\n# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop\n\n# change focus\nbindsym $mod+j focus left\nbindsym $mod+k focus down\nbindsym $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# 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\nbindsym $mod+w 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\n# focus the child container\n#bindsym $mod+d focus child\n\n# Define names for default workspaces for which we configure key bindings later on.\n# We use variables to avoid repeating the names in multiple places.\nset $ws1 \"1\"\nset $ws2 \"2\"\nset $ws3 \"3\"\nset $ws4 \"4\"\nset $ws5 \"5\"\nset $ws6 \"6\"\nset $ws7 \"7\"\nset $ws8 \"8\"\nset $ws9 \"9\"\nset $ws10 \"10\"\n\n# switch to workspace\nbindsym $mod+1 workspace number $ws1\nbindsym $mod+2 workspace number $ws2\nbindsym $mod+3 workspace number $ws3\nbindsym $mod+4 workspace number $ws4\nbindsym $mod+5 workspace number $ws5\nbindsym $mod+6 workspace number $ws6\nbindsym $mod+7 workspace number $ws7\nbindsym $mod+8 workspace number $ws8\nbindsym $mod+9 workspace number $ws9\nbindsym $mod+0 workspace number $ws10\n\n# move focused container to workspace\nbindsym $mod+Shift+1 move container to workspace number $ws1\nbindsym $mod+Shift+2 move container to workspace number $ws2\nbindsym $mod+Shift+3 move container to workspace number $ws3\nbindsym $mod+Shift+4 move container to workspace number $ws4\nbindsym $mod+Shift+5 move container to workspace number $ws5\nbindsym $mod+Shift+6 move container to workspace number $ws6\nbindsym $mod+Shift+7 move container to workspace number $ws7\nbindsym $mod+Shift+8 move container to workspace number $ws8\nbindsym $mod+Shift+9 move container to workspace number $ws9\nbindsym $mod+Shift+0 move container to workspace number $ws10\n\n# reload the configuration file\nbindsym $mod+Shift+c reload\n# restart i3 inplace (preserves your layout\/session, can be used to upgrade i3)\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 Down resize grow height 10 px or 10 ppt\n        bindsym Up 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 or $mod+r\n        bindsym Return mode \"default\"\n        bindsym Escape mode \"default\"\n        bindsym $mod+r mode \"default\"\n}\n\nbindsym $mod+r mode \"resize\"\n\n# Start i3bar to display a workspace bar (plus the system information i3status\n# finds out, if available)\nbar {\n        status_command i3status\n}\n<\/code><\/pre>\n\n\n\n<p>We have customized the configuration file and thus, below is our sample i3 wm configuration;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat <strong>~\/.config\/i3\/config<\/strong><\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code># 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\nset $black       #282828\nset $darkblack   #1d2021\nset $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: \"\n#set $ws2 \"2: \"\nset $ws2 \"2: \"\nset $ws3 \"3: \"\nset $ws4 \"4: \"\nset $ws5 \"5: \"\nset $ws6 \"6:\"\nset $ws7 \"7:\"\nset $ws8 \"8: \"\nset $ws9 \"9: \"\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\n#bindsym XF86MonBrightnessUp exec sudo ybacklight -inc 5 # increase screen brightness\n#bindsym XF86MonBrightnessDown exec sudo ybacklight -dec 5 # decrease screen brightness\nbindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl -q set 5%-\nbindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl -q set 5%+\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.png\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<p>There are some lines that are referencing my user&#8217;s home directory;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>bindsym $mod+l exec i3lock -i <strong>\/home\/kifarunix<\/strong>\/Pictures\/linuxtux.png<\/li>\n\n\n\n<li>bindsym $mod+Shift+f exec <strong>\/home\/kifarunix<\/strong>\/.config\/i3\/bin\/rofifinder<\/li>\n\n\n\n<li>exec_always feh &#8211;bg-scale <strong>\/home\/kifarunix<\/strong>\/Pictures\/linux-wallpaper.png<\/li>\n\n\n\n<li>bindsym t exec &#8220;pcmanfm <strong>\/home\/kifarunix<\/strong>&#8220;<\/li>\n\n\n\n<li>bindsym l exec i3lock -i <strong>\/home\/kifarunix<\/strong>\/Pictures\/linuxtux.png, mode &#8220;default&#8221;<\/li>\n<\/ul>\n\n\n\n<p>Be sure to update them accordingly!<\/p>\n\n\n\n<p>The above configuration should give you such a window (that is after all the configurations below is done);<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1919\" height=\"184\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/general-i3-wm.png\" alt=\"\" class=\"wp-image-7045\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/general-i3-wm.png?v=1601229485 1919w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/general-i3-wm-768x74.png?v=1601229485 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/general-i3-wm-1536x147.png?v=1601229485 1536w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/figure>\n\n\n\n<p>To use the above config, make a backup of the default configuration and paste the contents above into config file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-is-needed-for-the-customization-above\">What is needed for the Customization above<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-requires-packages\">Install Requires packages<\/h4>\n\n\n\n<p>A number of packages are requires for the above display and various shortcuts defined in the configuration file above;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>sudo apt install feh \\\n\tfonts-font-awesome \\\n\trofi \\\n\tpulseaudio-utils \\\n\txbacklight \\\n\talsa-tools \\\n\tclipit \\\n\tgcc \\\n\tgit \\\n\tterminator \\\n\tlocate \\\n\tpcmanfm \\\n\tacpi \\\n\tlibnotify-bin \\\n\thtop \\\n\tshutter \\\n\tcompton \\\n        i3blocks \\\n        plocate\n<\/code><\/pre>\n\n\n\n<p>Install <strong><a href=\"https:\/\/github.com\/Hummer12007\/brightnessctl?tab=readme-ov-file\" target=\"_blank\" rel=\"noreferrer noopener\">brightnessctl<\/a><\/strong> for controlling the screen brightness if xbacklight doesn&#8217;t work;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/tmp;git clone https:\/\/github.com\/Hummer12007\/brightnessctl.git<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>cd brightnessctl;.\/configure;sudo make install<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-i-3-logout-script\">Install i3 Logout Script<\/h4>\n\n\n\n<p>As defined the i3 configuration above, log out script, which gives such an logout interface shown below upon pressing <strong><code>$mod+p<\/code><\/strong> key combination, is installed under, <code><strong>~\/.config\/i3\/bin\/logout<\/strong><\/code>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"608\" height=\"557\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/logout-screen.png\" alt=\"\" class=\"wp-image-7046\" title=\"\"><\/figure><\/div>\n\n\n<p>Create the i3 binary scripts directory and install the logout script.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir ~\/.config\/i3\/bin\/<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\ncat > ~\/.config\/i3\/bin\/logout << 'EOL'\n#!\/usr\/bin\/env bash\n# Manage logout with rofi\noption=`echo -e \"suspend\\nlock screen\\nlogout\\nreboot\\npoweroff\\nKill user $USER\" | rofi -width 600 -dmenu -p system:`\ncase $option in\n    suspend)\n        sudo  \/usr\/bin\/systemctl syspend\n        ;;\n    'lock screen')\n        i3lock -i \/home\/kifarunix\/Pictures\/linuxtux.png\n        ;;\n    logout)\n        i3-nagbar -t warning -m 'Are you sure you  want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'\n        ;;\n    reboot)\n        \/usr\/bin\/systemctl reboot\n        ;;\n    poweroff)\n        \/usr\/bin\/systemctl poweroff\n        ;;\n    'kill user $USER')\n        loginctl kill-user $USER\n        ;;\nesac\nEOL\n<\/code><\/pre>\n\n\n\n<p>NB: The script is a modified version of the logout script provided on the <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/jmutai\/dotfiles\/blob\/master\/.config\/i3\/bin\" target=\"_blank\">Jmutai dotfiles<\/a> github repository.Be sure to make the script executable;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x ~\/.config\/i3\/bin\/logout<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"search-and-locate-files-using-rofi\">Search and Locate Files using Rofi<\/h4>\n\n\n\n<p>The rofi can be used to search for and locate files and folders within your system. Below is the rofi finder script we use;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>cat &gt; ~\/.config\/i3\/bin\/rofifinder &lt;&lt; 'EOL'\n#!\/bin\/bash\nxdg-open \"$(locate -i \/ | rofi -threads 0 -width 100 -dmenu -i -p \"Find\")\"\nEOL\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x ~\/.config\/i3\/bin\/rofifinder<\/code><\/pre>\n\n\n\n<p>The rofi finder can be launched, as per our config, by pressing <code><strong>$mod+Shift+f<\/strong><\/code> key combination. This is how it looks like;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1909\" height=\"555\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/rofifinder.png\" alt=\"Rofi finder Ubuntu 24.04\" class=\"wp-image-7047\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/rofifinder.png?v=1601229686 1909w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/rofifinder-768x223.png?v=1601229686 768w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/rofifinder-1536x447.png?v=1601229686 1536w\" sizes=\"(max-width: 1909px) 100vw, 1909px\" \/><\/figure>\n\n\n\n<p>Note that the script uses <code>locate<\/code> command. There install it, if not already install, and update the plocate (mlocate) database;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install plocate -y &amp;&amp; sudo updatedb<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"launching-system-apps-using-rofi\">Launching System Apps using Rofi<\/h4>\n\n\n\n<p>You can as well configure rofi to launch your system applications with i3-dmenu-desktop. Below is the script used in this guide to launch system apps;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>cat &gt; ~\/.config\/i3\/bin\/rofi_app_launcher &lt;&lt; 'EOL'\n#!\/usr\/bin\/env bash\n# Run rofi app launcher\ni3-dmenu-desktop --dmenu=\"rofi -dmenu -i -p 'apps'\"\nEOL\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x ~\/.config\/i3\/bin\/rofi_app_launcher<\/code><\/pre>\n\n\n\n<p>The i3 configuration for rofi app launcher is (define in the <strong>~\/.config\/i3\/config<\/strong>);<\/p>\n\n\n\n<pre class=\"scroll-box\"><code># start dmenu (a program launcher)\nbindsym $mod+d exec --no-startup-id ~\/.config\/i3\/bin\/rofi_app_launcher\n<\/code><\/pre>\n\n\n\n<p>The shortcut for launching the rofi app launcher as per our config is, <strong><code>$mod+d<\/code><\/strong>. See sample launch menu screen;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"967\" height=\"556\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/rofi_app_launcher.png\" alt=\"rofi app launcher\" class=\"wp-image-7048\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/rofi_app_launcher.png?v=1601229740 967w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/rofi_app_launcher-768x442.png?v=1601229740 768w\" sizes=\"(max-width: 967px) 100vw, 967px\" \/><\/figure><\/div>\n\n\n<p>To customize the rofi window, use <code><strong>rofi-theme-selector<\/strong><\/code> command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rofi-theme-selector<\/code><\/pre>\n\n\n\n<p>Press ENTER to check each theme!<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"other-customizations\">Other customizations;<\/h4>\n\n\n\n<p>Enable Print Screen using shutter<\/p>\n\n\n\n<pre class=\"scroll-box\"><code># Enable Print Screen\n#bindsym --release $mod+Print exec gnome-screenshot -i\nbindsym --release $mod+Print exec shutter -s\n<\/code><\/pre>\n\n\n\n<p>Killing a focussed windows;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code># kill focused window\nbindsym $mod+q kill\n<\/code><\/pre>\n\n\n\n<p>Changing Focus between different windows in a Workspace (see the respective key shortcuts);<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code># 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<\/code><\/pre>\n\n\n\n<p>Splitting a Window vertically (<strong>$mod+v<\/strong>) or horizontally (<strong>$mod+h<\/strong>);<\/p>\n\n\n\n<pre class=\"scroll-box\"><code># split in horizontal orientation\nbindsym $mod+h split h\n\n# split in vertical orientation\nbindsym $mod+v split v\n<\/code><\/pre>\n\n\n\n<p>Set a window in a full screen mode (<strong>$mod+f<\/strong>);<\/p>\n\n\n\n<pre class=\"scroll-box\"><code># enter fullscreen mode for the focused container\nbindsym $mod+f fullscreen toggle\n<\/code><\/pre>\n\n\n\n<p>Set a window to tiling or floating mode (<strong><code>$mod+Shift+space<\/code><\/strong>);<\/p>\n\n\n\n<pre class=\"scroll-box\"><code># toggle tiling \/ floating\nbindsym $mod+Shift+space floating toggle\n<\/code><\/pre>\n\n\n\n<p>Changing the focus of the parent or child window;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code># focus the parent container\nbindsym $mod+a focus parent\n# focus the child container\nbindsym $mod+z focus child\n<\/code><\/pre>\n\n\n\n<p>Setting Icons for different Workspaces;<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code># Workspace Variables\nset $ws1 \"1:<i class=\"fab fa-linux\"><\/i> \"\n#set $ws2 \"2:<i class=\"fa fa-firefox\" aria-hidden=\"true\"><\/i> \"\nset $ws2 \"2:<i class=\"fab fa-chrome\"><\/i> \"\nset $ws3 \"3:<i class=\"fa fa-book\" aria-hidden=\"true\"><\/i> \"\nset $ws4 \"4:<i class=\"fa fa-folder-open-o\" aria-hidden=\"true\"><\/i> \"\nset $ws5 \"5:<i class=\"fa fa-desktop\" aria-hidden=\"true\"><\/i> \"\nset $ws6 \"6:<i class=\"fa fa-skype\" aria-hidden=\"true\"><\/i>\"\nset $ws7 \"7:<i class=\"fa fa-envelope-o\" aria-hidden=\"true\"><\/i>\"\nset $ws8 \"8:<i class=\"fa fa-windows\" aria-hidden=\"true\"><\/i> \"\n<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"398\" height=\"24\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/i3workspace-icons.png\" alt=\"\" class=\"wp-image-7050\" title=\"\"><\/figure><\/div>\n\n\n<p>You can search for these icons on <a href=\"https:\/\/fontawesome.com\/icons\" target=\"_blank\" rel=\"noreferrer noopener\">FontAwesome icons<\/a> page and copy the glyph of your preferred icon and paste between the colon (:) and closing quote (\").<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1215\" height=\"602\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/copy-fontawesome-icon.png\" alt=\"\" class=\"wp-image-11803\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/copy-fontawesome-icon.png?v=1646469318 1215w, https:\/\/kifarunix.com\/wp-content\/uploads\/2022\/03\/copy-fontawesome-icon-768x381.png?v=1646469318 768w\" sizes=\"(max-width: 1215px) 100vw, 1215px\" \/><\/figure>\n\n\n\n<p>The icons used above are: linux, chrome, book, open folder, display, skype, envelop, windows and circle-play.<\/p>\n\n\n\n<p>Note we also bind various applications to their respective workspaces;<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code># 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<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"set-i-3-wallpaper\">Set i3 Wallpaper<\/h4>\n\n\n\n<p>First off, let us set a wallpaper. i3 wallpaper can be set using <code>feh<\/code>, a light-weight, configurable and versatile image viewer. Run the command on terminal.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">feh --bg-scale <strong>\/path\/to\/wallpaper.jpg<\/strong><\/pre>\n\n\n\n<p>This should automatically change  your wallpaper. To ensure that the wallpaper is set always when you login to your i3 session, edit the <strong>~\/.config\/i3\/config<\/strong> and set the correct path to your wallpaper image;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">exec_always feh --bg-scale <strong>\/path\/to\/wallpaper.jpg<\/strong><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"configure-i-3-blocks\">Configure i3blocks<\/h4>\n\n\n\n<p><a href=\"https:\/\/github.com\/vivien\/i3blocks\" target=\"_blank\" rel=\"noreferrer noopener\">i3blocks<\/a> is an alternative to i3status. i3blocks is available on the default Ubuntu 24.04 repos. Install i3blocks and it by running the command below (if not already installed);<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt install i3blocks<\/code><\/pre>\n\n\n\n<p>Next, configure i3 to use i3blocks instead of i3status by replacing the i3 <code>bar {}<\/code> section with the configs below;<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code># 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<\/code><\/pre>\n\n\n\n<p>This should change the i3 status bar.<\/p>\n\n\n\n<p>You as well need i3blocks blocklets. <em>\"A blocklet is the configuration of a single block, part of the status line\"<\/em>. You can find a comprehensive list of blocklets in the&nbsp;<a href=\"https:\/\/vivien.github.io\/i3blocks\/blocklets\" target=\"_blank\" rel=\"noopener\">blocklets page<\/a>.<\/p>\n\n\n\n<p>In my setup, most of the scripts are taken from <a href=\"https:\/\/github.com\/vivien\/i3blocks-contrib\" target=\"_blank\" rel=\"noreferrer noopener\">vivien blocklets<\/a>.<\/p>\n\n\n\n<p>Before you can proceed to get the blocklets scripts, edit the <strong><code>i3blocks.conf<\/code><\/strong> to define your icon fonts. <a href=\"https:\/\/fontawesome.com\/icons\" target=\"_blank\" rel=\"noreferrer noopener\">Font-Awesome<\/a> icons are used in this guide;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vim \/etc\/i3blocks.conf<\/code><\/pre>\n\n\n\n<p>Replace the icons appropriately. e.g<\/p>\n\n\n\n<p>Replace the html;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;i class=\"fa fa-tachometer\"&gt;&lt;\/i&gt;<\/code><\/pre>\n\n\n\n<p>With the icon itself (Copy and Paste the ICON). And do the same for rest<\/p>\n\n\n\n<pre class=\"scroll-box\"><code># i3blocks config file\n#\n# Please see man i3blocks for a complete reference!\n# The man page is also hosted at http:\/\/vivien.github.io\/i3blocks\n#\n# List of valid properties:\n#\n# align\n# color\n# command\n# full_text\n# instance\n# interval\n# label\n# min_width\n# name\n# separator\n# separator_block_width\n# short_text\n# signal\n# urgent\n\n# Global properties\n#\n# The top properties below are applied to every block, but can be overridden.\n# Each block command defaults to the script name to avoid boilerplate.\ncommand=~\/.config\/i3\/blocklets\/$BLOCK_NAME\nseparator=false\nseparator_block_width= 10\nmarkup=pango\nalign=right\n\n# RAM usage\n[memory]\ninterval=1\nlabel=&lt;i class=\"fa fa-tachometer\">&lt;\/i> \ncolor=#4CAF50\n\n# CPU Usage\n[cpu_usage]\nlabel= &lt;i class=\"fa fa-crosshairs\" aria-hidden=\"true\">&lt;\/i>\ninterval=2\ncolor=#87AFAF\n\n# \/home Partition Usage\n[disk-home]\nlabel=&lt;i class=\"fa fa-home\" aria-hidden=\"true\">&lt;\/i>:\ninterval=30\ncolor=#586E75\n\n# Network Interface IP\n[iface]\ncolor=#B4B7B4\ninterval=1\nseparator=false\nlabel= &lt;i class=\"fa fa-exchange\" aria-hidden=\"true\">&lt;\/i>\n\n# Wi-Fi SSID\n[ssid]\nlabel=  &lt;i class=\"fa fa-wifi\" aria-hidden=\"true\">&lt;\/i>\ncolor=#d33682\ninterval=2\n\n#Network Bandwidth\n[bandwidth]\ninterval=1\ncolor=#d33682\n\n# Screen brightness\n[brightness]\nlabel= &lt;i class=\"fa fa-adjust\" aria-hidden=\"true\">&lt;\/i>\ninterval=1\nsignal=2\ncolor=#738899\n\n# Battery level\n[battery]\ninterval=10\n\n# Date and Time Calendar\n[time]\nlabel= &lt;i class=\"fa fa-calendar\">&lt;\/i>\ninterval=1\ncolor=#50C878\n\n# Battery level notification\n[batnotify]\ninterval=10\nseparator_block_width=4\n<\/code><\/pre>\n\n\n\n<p>Create a directory to store the blocklets scripts;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir ~\/.config\/i3\/blocklets<\/code><\/pre>\n\n\n\n<p>Some of the blocklets that are used in this setup are;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls .config\/i3\/blocklets\/ -1<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>bandwidth\nbatnotify\nbattery\nbrightness\ncpu_usage\ndisk-home\niface\nmemory\nssid\ntime\n<\/code><\/pre>\n\n\n\n<p>Copy and paste the commands below to create the scripts contents;<\/p>\n\n\n\n<p>RAM Usage;<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code>\ncat > .config\/i3\/blocklets\/memory << 'EOL'\n#!\/bin\/sh\n# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>\n\n# This program is free software: you can redistribute it and\/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\nTYPE=\"${BLOCK_INSTANCE:-mem}\"\n\nawk -v type=$TYPE '\n\/^MemTotal:\/ {\n\tmem_total=$2\n}\n\/^MemFree:\/ {\n\tmem_free=$2\n}\n\/^Buffers:\/ {\n\tmem_free+=$2\n}\n\/^Cached:\/ {\n\tmem_free+=$2\n}\n\/^SwapTotal:\/ {\n\tswap_total=$2\n}\n\/^SwapFree:\/ {\n\tswap_free=$2\n}\nEND {\n\tif (type == \"swap\") {\n\t\tfree=swap_free\/1024\/1024\n\t\tused=(swap_total-swap_free)\/1024\/1024\n\t\ttotal=swap_total\/1024\/1024\n\t} else {\n\t\tfree=mem_free\/1024\/1024\n\t\tused=(mem_total-mem_free)\/1024\/1024\n\t\ttotal=mem_total\/1024\/1024\n\t}\n\tpct=used\/total*100\n\n\t# full text\n\tprintf(\"%.1fG\/%.1fG (%.f%%)\\n\", used, total, pct)\n\n\t# short text\n\tprintf(\"%.f%%\\n\", pct)\n\n\t# color\n\tif (pct > 90) {\n\t\tprint(\"#FF0000\\n\")\n\t} else if (pct > 80) {\n\t\tprint(\"#FFAE00\\n\")\n\t} else if (pct > 70) {\n\t\tprint(\"#FFF600\\n\")\n\t}\n}\n' \/proc\/meminfo\n\ncase $BLOCK_BUTTON in\n    1)\n        termite -e  htop\n        ;;\nesac\nEOL\n<\/code><\/pre>\n\n\n\n<p>CPU Usage script;<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code>\ncat > .config\/i3\/blocklets\/cpu_usage << 'EOL'\n#!\/usr\/bin\/perl\n#\n# Copyright 2014 Pierre Mavro <deimos@deimos.fr>\n# Copyright 2014 Vivien Didelot <vivien@didelot.org>\n# Copyright 2014 Andreas Guldstrand <andreas.guldstrand@gmail.com>\n#\n# Licensed under the terms of the GNU GPL v3, or any later version.\n\nuse strict;\nuse warnings;\nuse utf8;\nuse Getopt::Long;\n\n# default values\nmy $t_warn = 50;\nmy $t_crit = 80;\nmy $cpu_usage = -1;\n\nsub help {\n    print \"Usage: cpu_usage [-w <warning>] [-c <critical>]\\n\";\n    print \"-w <percent>: warning threshold to become yellow\\n\";\n    print \"-c <percent>: critical threshold to become red\\n\";\n    exit 0;\n}\n\nGetOptions(\"help|h\" => \\&help,\n           \"w=i\"    => \\$t_warn,\n           \"c=i\"    => \\$t_crit);\n\n# Get CPU usage\n$ENV{LC_ALL}=\"en_US\"; # if mpstat is not run under en_US locale, things may break, so make sure it is\nopen (MPSTAT, 'mpstat 1 1 |') or die;\nwhile (<MPSTAT>) {\n    if (\/^.*\\s+(\\d+\\.\\d+)\\s+$\/) {\n        $cpu_usage = 100 - $1; # 100% - %idle\n        last;\n    }\n}\nclose(MPSTAT);\n\n$cpu_usage eq -1 and die 'Can\\'t find CPU information';\n\n# Print short_text, full_text\nprintf \"%.2f%%\\n\", $cpu_usage;\nprintf \"%.2f%%\\n\", $cpu_usage;\n\n# Print color, if needed\nif ($cpu_usage >= $t_crit) {\n    print \"#C75D50\\n\";\n    exit 33;\n} elsif ($cpu_usage >= $t_warn) {\n    print \"#D7875F\\n\";\n}\n\nexit 0;\nEOL\n<\/code><\/pre>\n\n\n\n<p>\/home Partition Usage;<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code>\ncat > .config\/i3\/blocklets\/disk-home << 'EOL'\n#!\/bin\/sh\n# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>\n\n# This program is free software: you can redistribute it and\/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\nDIR=\"${BLOCK_INSTANCE:-$HOME}\"\nALERT_LOW=\"${1:-10}\" # color will turn red under this value (default: 10%)\n\ndf -h -P -l \"$DIR\" | awk -v alert_low=$ALERT_LOW '\n\/\\\/.*\/ {\n\t# full text\n\tprint $4\n\n\t# short text\n\tprint $4\n\n\tuse=$5\n\n\t# no need to continue parsing\n\texit 0\n}\n\nEND {\n\tgsub(\/%$\/,\"\",use)\n\tif (100 - use < alert_low) {\n\t\t# color\n\t\tprint \"#FF0000\"\n\t}\n}\n'\n# Mouse settings\ncase $BLOCK_BUTTON in\n    1) i3-msg exec 'caja --browser' ;;    # left click, locate +xdg-open files with rofi\n    3) i3-msg exec ~\/.config\/i3\/bin\/rofi_finder # find files on right click\nesac\nEOL\n<\/code><\/pre>\n\n\n\n<p>Default route Network Interface IP<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code>\ncat > .config\/i3\/blocklets\/iface << 'EOL'\n#!\/bin\/bash\n# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>\n# Copyright (C) 2014 Alexander Keller <github@nycroth.com>\n\n# This program is free software: you can redistribute it and\/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\n#------------------------------------------------------------------------\n\n# Use the provided interface, otherwise the device used for the default route.\nif [[ -n $BLOCK_INSTANCE ]]; then\n  IF=$BLOCK_INSTANCE\nelse\n  IF=$(ip route | awk '\/^default\/ { print $5 ; exit }')\nfi\n\n#------------------------------------------------------------------------\n\n# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless\n# connection (think desktop), the corresponding block should not be displayed.\n[[ ! -d \/sys\/class\/net\/${IF} ]] && exit\n\n#------------------------------------------------------------------------\n\nif [[ \"$(cat \/sys\/class\/net\/$IF\/operstate)\" = 'down' ]]; then\n  echo down # full text\n  echo down # short text\n  echo \\#FF0000 # color\n  exit\nfi\n\ncase $1 in\n  -4)\n    AF=inet ;;\n  -6)\n    AF=inet6 ;;\n  *)\n    AF=inet6? ;;\nesac\n\n# if no interface is found, use the first device with a global scope\nIPADDR=$(ip addr show $IF | perl -n -e \"\/$AF ([^\\\/]+).* scope global\/ && print \\$1 and exit\")\n\ncase $BLOCK_BUTTON in\n    1)\n        termite -e 'ping 8.8.8.8'         ;;\n\n    3) echo -n \"$IPADDR\" | xclip -q -se c \n        ;;\nesac\n\n#------------------------------------------------------------------------\n\necho \"$IPADDR\" # full text\necho \"$IPADDR\" # short text\nEOL\n<\/code><\/pre>\n\n\n\n<p>Wi-Fi SSID (<strong># Be sure to change the WLAN interface<\/strong>);<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>cat &gt; .config\/i3\/blocklets\/ssid &lt;&lt; 'EOL'\n#!\/usr\/bin\/env bash\n<strong># Be sure to change the WLAN interface<\/strong>\necho \"$(iw dev wlp0s20f3 link | grep SSID | cut -d \" \" -f 2-)\"\nEOL\n<\/code><\/pre>\n\n\n\n<p>Network Bandwidth;<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code>\ncat > .config\/i3\/blocklets\/bandwidth << 'EOL'\n#!\/bin\/bash\n\n# Use the provided interface, otherwise the device used for the default route.\nif [[ -n $BLOCK_INSTANCE ]]; then\n  INTERFACE=$BLOCK_INSTANCE\nelse\n  INTERFACE=$(ip route | awk '\/^default\/ { print $5 ; exit }')\nfi\n\n# # if the connection is down, the corresponding block should not be displayed.\nif ! [ -e \"\/sys\/class\/net\/${INTERFACE}\/operstate\" ] || ! [ \"`cat \/sys\/class\/net\/${INTERFACE}\/operstate`\" = \"up\" ]\nthen\n    exit 0\nfi\n\n# path to store the old results in\npath=\"\/dev\/shm\/$(basename $0)-${INTERFACE}\"\n\n# grabbing data for each adapter.\nread rx < \"\/sys\/class\/net\/${INTERFACE}\/statistics\/rx_bytes\"\nread tx < \"\/sys\/class\/net\/${INTERFACE}\/statistics\/tx_bytes\"\n\n# get time\ntime=$(date +%s)\n\n# write current data if file does not exist. Do not exit, this will cause\n# problems if this file is sourced instead of executed as another process.\nif ! [[ -f \"${path}\" ]]; then\n  echo \"${time} ${rx} ${tx}\" > \"${path}\"\n  chmod 0666 \"${path}\"\nfi\n\n# read previous state and update data storage\nread old < \"${path}\"\necho \"${time} ${rx} ${tx}\" > \"${path}\"\n\n# parse old data and calc time passed\nold=(${old\/\/;\/ })\ntime_diff=$(( $time - ${old[0]} ))\n\n# sanity check: has a positive amount of time passed\n[[ \"${time_diff}\" -gt 0 ]] || exit\n\n# calc bytes transferred, and their rate in byte\/s\nrx_diff=$(( $rx - ${old[1]} ))\ntx_diff=$(( $tx - ${old[2]} ))\nrx_rate=$(( $rx_diff \/ $time_diff ))\ntx_rate=$(( $tx_diff \/ $time_diff ))\n\n# shift by 10 bytes to get KiB\/s. If the value is larger than\n# 1024^2 = 1048576, then display MiB\/s instead\n\n# outgoing\ntx_kib=$(( $tx_rate >> 10 ))\nif [[ \"$tx_rate\" -gt 1048576 ]]; then\n    tx_mbs=$(printf '%s' \"`echo \"scale=1; $tx_kib \/ 1024\" | bc`\")\n  echo -n \"${tx_mbs}<span font='8' foreground='#969896'>M<\/span><span foreground='#B294BB'>\u2191<\/span><span font='3' foreground='#282A2E'>.<\/span>\"\nelse\n  echo -n \"${tx_kib}<span font='8' foreground='#969896'>K<\/span><span foreground='#B294BB'>\u2191<\/span><span font='3' foreground='#282A2E'>.<\/span>\"\nfi\n\n# incoming\nrx_kib=$(( $rx_rate >> 10 ))\nif [[ \"$rx_rate\" -gt 1048576 ]]; then\n    rx_mbs=$( printf '%s' \"`echo \"scale=1; $rx_kib \/ 1024\" | bc`\")\n  echo -n \"${rx_mbs}<span font='8' foreground='#969896'>M<\/span><span foreground='#81A2BE'>\u2193<\/span>\"\nelse\n  echo -n \"${rx_kib}<span font='8' foreground='#969896'>K<\/span><span foreground='#81A2BE'>\u2193<\/span>\"\nfi\n\n# mouse buttons  \ncase $BLOCK_BUTTON in\n    1) tm-cli ;; # transmission-remote-cli\n    3) rofi-connm # rofi connection manager \nesac\nEOL\n<\/code><\/pre>\n\n\n\n<p>System Battery status;<\/p>\n\n\n\n<p>Check the battery instance and replace the value x in <code><strong>BAT<\/strong><\/code>x;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls \/sys\/class\/power_supply\/<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\ncat > .config\/i3\/blocklets\/battery << 'EOL'\n!\/bin\/sh\n# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>\n\n# This program is free software: you can redistribute it and\/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\nINSTANCE=\"${1:-BAT1}\"\nALERT_LOW=\"${2:-25}\" # color will turn red under this value (default: 10%)\nUPOWER=\"\/usr\/bin\/upower\"\n\nif [ ! -x \"$UPOWER\" ]; then\n\techo \"upower not found\"\n\texit 1\nfi\n\n$UPOWER -i \/org\/freedesktop\/UPower\/devices\/battery_$INSTANCE |\n\tawk -v alert_low=$ALERT_LOW '\n\/state:\/ {\n\tstate = $2\n}\n\/time to full:\/ {\n\tremaining_time = $4 \" \" substr ($5, 0, 1)\n}\n\/time to empty:\/ {\n\tremaining_time = $4 \" \" substr ($5, 0, 1)\n}\n\/percentage:\/ {\n\tpercentage = $2;\n}\nEND {\n\tif (state == \"charging\")\n        label = \"<i class=\"fa fa-plug\" aria-hidden=\"true\"><\/i>\"\n\telse if (percentage == \"100%\")\n\t\tlabel = \"<i class=\"fa fa-battery-full\" aria-hidden=\"true\"><\/i>\"\n\telse if (percentage > 99)\n\t\tlabel = \"<i class=\"fa fa-battery-full\" aria-hidden=\"true\"><\/i>\"\n\telse if (percentage > 75)\n\t\tlabel = \"<i class=\"fa fa-battery-three-quarters\" aria-hidden=\"true\"><\/i>\"\n\telse if (percentage > 50)\n\t\tlabel = \"<i class=\"fa fa-battery-half\" aria-hidden=\"true\"><\/i>\"\n\telse if (percentage > 25)\n\t\tlabel = \"<i class=\"fa fa-battery-quarter\" aria-hidden=\"true\"><\/i>\"\n    else if (percentage > 10) \n\t\tlabel = \"\uf243\"\n    else if (percentage > 5)  \n\t\tlabel = \"<i class=\"fa fa-battery-empty\" aria-hidden=\"true\"><\/i>\"\n\t\n    # full text & \"$@\" > \/dev\/null;\n    print label \" \" percentage\n\n\t# short text\n\tprint label \" \" percentage\n\n\t# color\n\tgsub(\/%$\/,\"\",percentage)\n    if (percentage == \"100\")\n\t\tprint \"#c5c8c6\"\n    else if (state == \"charging\")\n\t\tprint \"#c5c8c6\"\n    else if (+ percentage < + alert_low)\n        print \"#cc6666\"\n    else if (percentage < 26)\n        print \"#af9f87\"\n    else\n        print \"#7ea3a3\"\n}\n# mouse buttons\ncase $BLOCK_BUTTON in\n  3) toggle-dpms ;; # left click, control DPMS \n  2) toggle-red ;;  # right click, redshift on\/off\n  1) getacpi ;; # dialog with battery info\n  5) sudo brightness up ;; \n  # xbacklight doesn't work with modesetting use brightness script\n  4) sudo brightness down ;; \nesac\nEOL\n<\/code><\/pre>\n\n\n\n<p>Date and Time Calendar;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>cat &gt; .config\/i3\/blocklets\/time &lt;&lt; 'EOL'\n#!\/bin\/bash\ndate_time=$(date '+%a %d-%m-%Y %R:%S')\necho \"$date_time\"\n\n#Buttons Control\ncase \"$BLOCK_BUTTON\" in\n    1) exec zenity --calendar\n        ;;\nesac\nEOL\n<\/code><\/pre>\n\n\n\n<p>Battery Discharge Notification script.<\/p>\n\n\n\n<p>Be sure to replace the battery instance, BATx accordingly.<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code>\ncat > .config\/i3\/blocklets\/batnotify << 'EOL'\n#!\/bin\/bash\n\n# Battery notifier script for i3\n# First warning is at 30%,  Critical warning less than 15%\n\ndischarge_mode=`acpi -a | grep -o off`\n\n# Get current battery level and set threshold\nbattery_level=$(cat \/sys\/class\/power_supply\/BAT1\/capacity)\ncritical_value=15\nwarning_value=30\n\n# Messages to print to notification\nmessage=\"*** Battery level is ${battery_level}%, critical, sleeping in 30 seconds time ***\"\nwarn_message=\"*** Battery level is ${battery_level}%, warning, connect your charger ***\"\n\n# Notification icon to use\nnot_icon=\"\/usr\/share\/icons\/gnome\/scalable\/status\/battery-low-symbolic.svg\"\n\nif [ \"$discharge_mode\" == \"off\" ]; then\n  if [  \"$battery_level\" -le \"$critical_value\" ]; then\n    if [ -f \"$not_icon\" ]; then\n        notify-send -u critical -i \"$not_icon\" -t 60000 \"$message\"\n       # i3-nagbar -m \"$message\"\n        sleep 300\n        sudo  \/lib\/systemd\/systemd-sleep hybrid-sleep\n    else\n         notify-send -u critical  -t 60000 \"$message\"\n        #i3-nagbar -m \"$message\"\n        sleep 120\n        sudo  \/lib\/systemd\/systemd-sleep hybrid-sleep\n\n    fi\n   elif [  \"$battery_level\" -eq \"$warning_value\" ]; then\n     notify-send -u low -i \"$not_icon\" -t 60000 \"$warn_message\"\nfi\nfi\nEOL\n<\/code><\/pre>\n\n\n\n<p>Ensure the blocklets are executable;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x ~\/.config\/i3\/blocklets\/*<\/code><\/pre>\n\n\n\n<p>This is how our i3 status bar now looks like;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1176\" height=\"45\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/i3-blocks.png\" alt=\"\" class=\"wp-image-7054\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/i3-blocks.png 1176w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/09\/i3-blocks-768x29.png 768w\" sizes=\"(max-width: 1176px) 100vw, 1176px\" \/><\/figure>\n\n\n\n<p>And that is pretty much it on our guide on how to install and setup i3 windows manager on Ubuntu 24.04. Feel free to customize this awesome tool to your liking. Enjoy!!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"further-reading\">Further Reading<\/h3>\n\n\n\n<p>Refer to i3 user's guide for a comprehensive i3 reference.<\/p>\n\n\n\n<p><a href=\"https:\/\/i3wm.org\/docs\/userguide.html\" target=\"_blank\" rel=\"noreferrer noopener\">i3 User's Guide<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"other-tutorials\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-and-setup-zsh-and-oh-my-zsh-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Setup ZSH and Oh-My-Zsh on Ubuntu 20.04\/Ubuntu 22.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to our tutorial on how to install i3 windows manager on Ubuntu 24.04. i3 is a tiling window manager for X11. &#8220;A&nbsp;tiling window manager&nbsp;is<\/p>\n","protected":false},"author":10,"featured_media":11814,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121],"tags":[7397,7395,7398],"class_list":["post-20127","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-i3-windows-manager-ubuntu-24-04","tag-install-i3-on-ubuntu-24-04","tag-ubuntu-24-04-i3-wm","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/20127"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=20127"}],"version-history":[{"count":8,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/20127\/revisions"}],"predecessor-version":[{"id":20926,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/20127\/revisions\/20926"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/11814"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=20127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=20127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=20127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}