Finishing the Linux desktop for geeks. Improved i3 and dmenu, pass password manager, surf browser, slock blocker, hotkey translator

Unlike awesome, its settings are written in a regular text file.

Features of i3wm for the user: correct support for multiple monitors (see screenshot at the end), simple text config file, no need to rebuild wm after changing settings, three window layout modes, dmenu application launch menu, creates desktops as needed and deletes empty ones, out of the box has an excellent information panel showing the level Wi-Fi networks, battery charge and much more.

Demonstration from the author i3

Installation

i3wm is available in the Debian, Arch, Gentoo, Ubunto, FreeBSD, NetBSD, OpenBSD, OpenSUSE, Mageia, Fedora and Exerbo repositories. I will tell you using Ubuntu 12.04 as an example.

The package you need is called i3, so:

# apt-get install i3

You can now select “i3” as the window manager on the user and password screen.

Settings

When you first start, you will be asked to select a modifier key. I chose win for compatibility with most applications.

Let's add switching to the Russian layout using Alt+Shift, autoloading dropbox, switching between desktops using mod+Control+Left/Right, locking the screen using mod+Control+l and sleep mode with locking the screen when exiting it using mod+Control+s .

Keyboard layout switching is configured using setxkbmap. For this purpose it is used

$ setxkbmap "us,ru" ",winkeys" "grp:alt_shift_toggle"

In order not to enter it every time after a reboot, we will create a .xsessionrc file in the user’s root folder, make it executable and bring it to the form:

#!/bin/sh exec setxkbmap "us,ru" ",winkeys" "grp:alt_shift_toggle"

For Dropbox autoload, the .xsessionrc will look like this:

#!/bin/sh exec setxkbmap "us,ru" ",winkeys" "grp:alt_shift_toggle" & dropbox start &

Now the next time you log into i3wm, Russian and English keyboards will be available.

Setting up i3 is usually done using a user config. Let's create a folder ~/.i3 and copy the configuration template into it:

$ cp /etc/i3/config ~/.i3/config

Usage

Some standard hotkeys that work by default:

mod+Enter opens terminal
mod+d launches dmenu (a menu at the top of the screen that, as you type the name of the application from the keyboard, offers options for launching)
mod+Shift+Q closes the active window

mod+v enables vertical tiling mode (the screen will be divided horizontally)
mod+h enables horizontal tiling mode (the screen will be divided vertically)

mod+w enables tab mode (each window on the desktop occupies the entire screen, with tabs visible at the top)
mod+s enables stacked mode (window titles one below the other, each window occupies the entire screen)
mod+e returns standard mode
mod+Shift+Space switches the window to floating mode and back

mod+Left/Right/Up/Down moves focus within the desktop
mod+Shift+Left/Right/Up/Down moves the current window within the desktop

mod+1 etc. switches to the desktop with the specified number

mod+Shift+C reads settings from a configuration file
mod+Shift+E exits i3wm to the username and password entry screen

Full options for setting up and using i3wm are described in the documentation.

Bonus

If you have two monitors, or a netbook's built-in screen and an external monitor like I do, then i3wm will work great on them. The most important thing is that this does not require any additional settings.

List of available monitors:

$xrandr -q

Let's set them up to work in pairs:

$ xrandr --output LVDS1 --mode 1366x768 --pos 0x0 --output VGA1 --mode 1280x1024 --pos 1366x0

where LVD1 is the monitor built into the netbook, its resolution is 1366x768 and it is pressed to the upper left corner, VGA1 is an external monitor, its resolution is 1280x1024 and it is shifted 1366 pixels to the right relative to the upper left corner.

It's been several months since I switched to " window manager" instead of "desktop environment". For a more technical and precise difference between these two concepts, you can google it. In terms of regular user(at least from what I felt) - WM (window manager) only manages windows, which means:

1) consumes less resources;

2) the main work will be with the keyboard, mouse only in the browser and in Gimp;

3) most of the settings need to be done through the terminal and configuration files, no general control panel, although this can be done.

For the average user, all this may seem complicated and unnecessary - so what, it consumes fewer resources, because I have 100500 GB of RAM and slightly fewer processor cores. Here's mine old laptop got a second life, the bare system (Ubuntu 16.04) without DE eats up only a little more than 200 MB of RAM. Well, the i3 tiled window manager (i3wm - improved windows manager), to which this post is dedicated, provides another wonderful opportunity - setting up multiple monitors with different resolutions is really easy.

So, you can start getting acquainted with the official website - https://i3wm.org/docs/userguide.html. To begin with, you can install it in addition to the regular DE and select the i3 session when logging in. And when you have enough strength to transfer completely, you can install a bare Linux distribution without DE and then immediately install this WM. Before loading the i3 session, be sure to write down a couple of key combinations and commands, because you will end up stuck with a blank black screen and will have to do a hard reset :)

When you first start, i3 will ask for a modifier key. I chose the “win” key for myself - at least it will have some benefit and will not interrupt other combinations. Now you can launch the terminal with the combination "win+Enter", and if you have a terminal, you have everything.

By the way, about the terminal emulator, my choice in i3 is urxvt, but for complete happiness you need to install the package rxvt-unicode-256color. It is not as functional as, for example, the standard Gnome one, but it is faster and looks beautiful in tile-based WM. Edit all urxvt settings in ~/.Xresources, after editing the file, run the command:

xrdb ~/.Xresources

The next important step for me is setting up the status bar; I especially wanted to have working icons for Dropbox and Skype. Of course, I wanted to customize the status bar that came out of the box - i3bar, although it is a little buggy. If you don't like it, put something else, i3wm won't be offended.

How i3bar works: the i3status utility reads the config file/etc/i3status.conf and feeds the received statuses as a string to the i3bar utility. Of course, you want to receive adequate statuses in an acceptable time, no more than a second. Therefore, in the config filein the general section, interval optionsyou need to set the value to 1. There is no point in going any faster, it will only add extra CPU load. But due to the fact that these statuses either queue up or something else, and my old netbook was so slow that it didn’t have time to process everything every second and processed the status in about 1.1 seconds, they were not displayed during. After an hour of work, the time difference (between the present and what was shown in the status line) became very large, about 15-20 minutes. Therefore, it was necessary to come up with something different. Fortunately, i3 allows you to write your own script to receive statuses and use it together with the built-in one, or even without the built-in one. So, the first version of the script:
#!/bin/sh # shell script to prepend i3status with more stuff i3status | while: do read line datetime = $(date +"%Y-%m-%d %H:%M:%S") echo "$datetime | $line" || exit 1 done

The principle of the script is simple: we read i3status, get what we are missing, and display this term further. In this option, all colors will be lost, since the colors are encoded with special sequences of characters and are eaten by the shell. But if you wish, you can add your own functions to wrap different parameters in colors.

To run this script instead of the standard i3status, you need to edit the bar section in ~/.config/i3/config:

Bar ( status_command ~/i3status.sh tray_output primary position top ) In the status_command option you need to specify full path to your script (or place it along one of the paths in the PATH variable).

The next thing I was terribly missing was the display of the layout and language. Again, i3wm is not for beginners; you will have to spend a lot of time and nerves. But once configured, you can easily transfer your settings to any other machine. You can also upload configuration files and automated scripts to GitHub and perform any setup from scratch in minutes. To manage layouts (so that each application has its own layout), you need to install kbdd. We configure the layouts themselves, the switching method and the launch of kbdd in ~/.xinitrc:

Setxkbmap "us,ua,ru" ",winkeys" "grp:shift_caps_toggle" kbdd exec i3

What does this all mean:

1) 3 layouts - us, ua, ru, switching combination shift + caps lock (by analogy, you can configure anything you want)

2) launch kbdd after installing the layouts

3) launch i3 session

In this case, all this will start when you execute the “startx” command. And startx will have to be executed, because the computer will boot in mode without X's and instead of a window with a login there will be a console with a login. By the way, this also needs to be configured correctly:

1) you need to fix the grub config

looking for a line

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

and change to

GRUB_CMDLINE_LINUX_DEFAULT="text"

then update the rough:

sudo update-grub

2) For systems that use systemd, additional settings need to be made:

Sudo systemctl enable multi-user.target --force sudo systemctl set-default multi-user.target

3) the screen locker itself with login also needs a console one, vlock is good for this, but you need to install version 2.2.2-3, not 2.2.2-5 (this one is more new version for some reason you can log in without a password from another tty). Well, then you’ll have to tell your package manager so that vlock does not update. Next, we set the screen lock to the standard combination (CTRL+ALT+L), to do this, add the line to ~/.config/i3/config:
bindsym ctrl+Mod1+l exec vlock -an

Now we need to configure the display of layouts in the status line, so the i3status.sh script will look something like this:

#!/bin/sh # shell script to prepend i3status with more stuff i3status | while: do read line datetime = $(date +"%Y-%m-%d %H:%M:%S") layouts=$(setxkbmap -query | awk "/layout/(print $2)") current =$(dbus-send --print-reply=literal --dest=ru.gentoo.KbddService /ru/gentoo/KbddService ru.gentoo.kbdd.getCurrentLayout | awk "( print $2 )") index=$(($ current+1)) lang=$(echo $layouts | cut -d, -f$index) echo "$lang | $datetime | $line" || exit 1 done

That is, the current layout will be shown before the date/time.

If you decide to install i3wm on your laptop, you will most likely want to display the battery charge level and battery level in the status bar. wifi signal. Battery level display can be customized standard means in the /etc/i3status.conf file (you may need to change the battery index from 0 to 1, or vice versa, depending on the laptop):
battery 1 ( format = "%status %percentage - %remaining" low_threshold = 30 threshold_type = time # toggle actual capacity/design capacity #last_full_capacity = true hide_seconds = true integer_battery_capacity = true ) Likewise, you may need to play around with the audio device index to display the volume:
volume master ( format = "♪: %volume" format_muted = "♪: muted (%volume)" device = "pulse:0" ) In this case, I regulate the volume itself through the pavucontrol program (if you also have Pulse, then the settings are essentially the same).

Well, the level of the wifi signal was not so easy to “get.” Personally, I succeeded through the CLI (Command Line Interface) of Network Manager. Perhaps you will find best way. By the way, you can search for wireless networks and connect to them through the same nmcli. So, the final version of the i3status.sh script for a laptop:
#!/bin/sh # shell script to prepend i3status with more stuff i3status | while: do read line layouts=$(setxkbmap -query | awk "/layout/(print $2)") current=$(dbus-send --print-reply=literal --dest=ru.gentoo.KbddService /ru/ gentoo/KbddService ru.gentoo.kbdd.getCurrentLayout | awk "( print $2 )") index=$(($current+1)) lang=$(echo $layouts | cut -d, -f$index) wifi=$ (nmcli d wifi | grep "^\*" | grep -v "\*.*SSID" | awk "( print $8 )") datetime=$(date +"%Y-%m-%d %H:% M:%S") echo "$lang | W: $wifi | $datetime" || exit 1 done Oh, and also disable “mouse click” on the touchpad, it’s terribly annoying. You need to add a line (# is a comment, not necessary to add, but the following line makes it clear) to the ~/.config/i3/config file:
# Turn off tap click (single finger, two fingers, and 3 fingers) exec synclient TapButton1=0 TapButton2=0 TapButton3=0 Icons. For some reason, it is the Dropbox icon that does not want to be displayed normally in the i3bar. It turns out that you need to launch dbus before starting dropbox, but I didn’t try to put this in any script, but Dropbox still launched without an icon. So far I have solved this problem by creating the dropbox_fix.sh script and adding the following line:

Dropbox stop; dbus-launch; dropbox start & And now every time I see that there is no icon, I run this script. Sometimes there are problems with displaying Skype and even Thunderbird icons. This can be treated more simply by simply rebooting the i3 “in place” (does not affect everything running programs), usually a combination of mod+shift+r. Yes, let me remind you once again that there are a lot of such small bugs, but I saw more advantages in i3wm, and my work computer does not turn off for months, which means I perform “starter bug fixes” very rarely.

Next, what else you need to know about the settings - in the config file ~/.config/i3/config, your selected modifier key will be designated as $mod, the alt key will be designated as Mod1, the win key will be designated Mod4. All other keys do not have such special designations. You can configure multiple monitors in the same file using the xrandr command.
And one more important thing - screenshots also need to be configured! But this is not a problem either. First, install the scrot utility - lightweight, fast and configurable. I hang a regular snapshot (the entire screen) on the PrintScreen button, and on Alt+PrintScreen - a snapshot of the current (active) window. Since the Alt key itself is a modifier, the most easy way to bind this combination is to specify an alternative value for the PrintScreen button, that is, SysRq. In total, add the following lines to the ~/.config/i3/config file:

# Take screenshots bindsym Print exec scrot "%Y-%m-%d_%H:%M:%S.png" -e "mv $f ~/Pictures/" bindsym Mod1+Sys_Req exec scrot -u "%Y- %m-%d_%H:%M:%S.png" -e "mv $f ~/Pictures/" As a result, all screenshots will end up in the ~/Pictures folder. If desired, you can configure even more flexibility. Here is an example screenshot from i3wm:

As you may remember, my first tile-based window manager was Xmonad. It suits me quite well on a desktop computer, but, unfortunately, on EeePC There is a lot of fuss with it - you need to finish the battery indicator, display the Wi-Fi signal level somewhere, etc. After a little consultation with people on Twitter, I decided to try the i3 window manager.

The i3 is installed something like this (oh, Bubunta):

sudo apt-get install i3 i3status i3lock dmenu

We finish working in the current window manager, enter the username and password, select the i3 window manager. When you first start i3 it will ask you whether to create a default config (yes, it goes without saying) and what to use as a Mod key (Win, because it's not needed for anything anyway).

That's it, we are working on i3. The basic keyboard shortcuts are as follows:

  • Mod + Enter - open a new terminal;
  • Mod + D - run any program via dmenu;
  • Mod + 0..9 — switching between workspaces;
  • Mod + Shift + 0..9 — moving windows to the specified workspace;
  • Mod + Shift + Q - close the current window;
  • Mod + Arrows - move between windows; instead of arrows, the keys “J” (left), “K” (down), “L” (up) and “;” can also be used. (right);
  • Mod + Shift + Arrows - moving windows within the workspace; letters and semicolons can also be used instead of arrows;
  • Mod + V - use vertical splitting;
  • Mod + H - use horizontal splitting;
  • Mod + E - default window placement (default layout);
  • Mod + S - stacking layout;
  • Mod + W - placement with tabs (tabbed layout);
  • Mod + F - expand the window to full screen or minimize it back;
  • Mod + Shift + Space — allow free movement of the window (floating mode) or return it to the mosaic;
  • Mod + Shift + R - restart i3 (for example, after updating the config);
  • Mod + Shift + E - exit i3;

You can resize windows by dragging their borders with the mouse. You can also switch to window resizing mode by pressing Mod + R. In this mode, using arrows or letters, you select the border of the window from which the window should be reduced or, if Shift is pressed, enlarged. Return to normal mode by pressing Enter or Escape.

Now consider the following screenshot (clickable):

To achieve this window arrangement, I first switched to vertical splitting (Mod + V) and created three windows (Mod + Enter). Then I selected each of the three windows in turn (Mod + Arrows), for each of them switched to horizontal splitting (Mod + H) and created two more windows. In the top row I left the default layout, in the middle I switched to tabbed layout (Mod + W), and in the bottom row I switched to stacked layout (Mod + S).

The important point here is that windows in i3 form a tree structure (with parents and children). Changing the partitioning method (Mod + H/V) creates a new container (subtree), and switching the layout affects only the current container. Thanks to this approach, i3 allows you to achieve a much more complex window arrangement than Xmonad.

The main i3 configuration files are ~/.i3/config and ~/.i3status.conf.

In ~/.i3/config I added:

bindsym $mod+t border toggle

Exec dropbox start
exec wicd-client -t
exec gxneur &

Bar (
position top
status_command i3status
}

The first line I added to the Mod + T combination was changing the border style. By default, windows in i3 have titles and borders, which may be completely unnecessary if, for example, you have Chrome open in full screen.

The next three lines add some programs to autorun. With Dropbox everything is clear. The wicd utility is a thing that hangs in the tray and allows you to manage connections to wired and wireless networks. It is installed as follows:

sudo apt-get install wicd
sudo /etc/init.d/wicd start

To prevent NetworkManager from interfering with wicd, we say:

sudo stop network manager

Also pay attention to the console analogue of wicd, the wicd-curses utility.

Addition: Everything turned out to be much simpler:

exec nm-applet &
exec blueman-applet &

Xneur, I think, needs no introduction. I used it simply as an indicator of the current keyboard layout (which, however, can be done without). Install xneur as follows:

sudo apt-get install xneur gxneur

At the end of the config (bar block), I say to display the panel with the clock, tray, and so on at the top of the screen, and not at the bottom, as is done by default.

I took the file /etc/i3status.conf as a basis for ~/.i3status.conf. In it, I corrected the format for displaying the current date, changed the names of network interfaces, and removed unnecessary information about IPv6, DHCP and VPN. I see no point in presenting the result here. What pleases us about i3 is its intuitive config format and good documentation.

Well, the final touch is to add the following line to ~/.bashrc:

alias lockscreen="i3lock -c 000000"

The i3lock utility is designed to lock the screen. Unlike many similar utilities, it nothing at all does not show to the user. That is, the screen stupidly remains black (the color can be changed) until the password is entered current user. In addition to a specific color, you can also use a PNG image.

end user guide to running the application on various operating systems and platforms

Installation

Apple iOS

Installation from " App Store" on iPad, iPhone, iPod touch:

Sign in account(store) iTunes on an iOS device. Follow the link to i3 pro or enter "i3 pro" in Search. Install the application.

Access restriction

Guided Access – “mode limited use» Apple iOS, standard iOS option since iOS 6.

Guided Access lets you lock the Home button so you can't exit the app. It also allows you to leave only part of the screen active, limiting work with its areas. Setting up and removing guide access is carried out using a password code. The lock screen and sleep continue to work.

setting:

Settings > General > Accessibility > Guided Access

The mode is useful when using iPad, iPhone, iPod touch as a stationary panel in a store, hotel, demo stand, showroom, exhibition, etc.


Google Android

The application is available for installation from Google Play or iRidium Mobile website:

  • Installation from Google Play

Open Google Play on your Android device, find the i3 pro application through Search and install it.

If Google Play does not allow you to install i3 pro (“the application is not supported by this device”):

  1. Open Android Settings devices.
  2. Allow installation third party applications, paragraph " Unknown sources". Usually this item is located in the "Security > Device Administration" section. However, depending on the version of Andorid, it may be in another section, for example, "Applications".
  3. Download the .apk file of the i3 pro application from the iRidium website through your browser Android devices.
  4. Start installing the application through the "Downloads" menu or from file manager(for example, "File Expert").

You can also download and install the .apk file of the application on your PC, and then upload it to the card Android memory devices for installation via a file manager.

Microsoft Windows

Download and install the i3 pro application from the iRidium Mobile website as part of the iRidium distribution kit ( Setup). The i3 pro.exe application is available in "Start > All Programs > iRidium Pro > iRidium Client".

Apple Mac OS X

  • The application is available for installation from the iRidium Mobile website:

Download the i3 pro distribution for OS X, unpack the archive with the program double click and copy the application to the Applications folder.

Run iTunes app on PC or Mac, enter "i3 pro" in the App Store Search, download the application. Sync your device with iTunes.

Authorization in the application

1 Press the button LOGIN & PASSWORD.

Button QR-CODE designed for BYOD system users.

2 Enter your email and password, then click SIGN IN.

Loading and running the project

The automation project is downloaded from the iRidium cloud. The integrator/developer must provide access to the object to the end user so that the project is available to him after authorization.

Via direct link

Just click the "cloud with arrow" button next to the desired project from the list.

Using the built-in QR code scanner

1 Swipe left to right on the screen. The system menu appears.

2 Press the button SCAN QR-CODE.

3 Scan the QR code provided.

Using a third party QR code scanner

1 First download the i3 pro application and log in to it.

But in fact they were declared unfit for use. The first - because it is configured through source code edits, the second - because the config is in lua and requires too many diamonds. (I'm curious how much time those sitting under these wm spent setting up).

i3 - rumored to require much less effort to set up. Well...we'll see.

We install i3, and also additional packages:

$ sudo apt-get install i3 i3status i3lock dmenu

Afterwards we log in under i3... voila. When you first start, i3 will ask several questions (where to store the config and what is considered a mod key, that is, a modifier key. I assigned a win key, this, by the way, is offered by default).

Basic keyboard shortcuts:

  • Mod + Enter - open a new terminal;
  • Mod + D - run any program via dmenu;
  • Mod + 0..9 - switching between workspaces (by the way, there are 10 of them. The current number is displayed in the lower left corner);
  • Mod + Shift + 0..9 - moving windows to a specified workspace;
  • Mod + Shift + Q - close the current window;
  • Mod + Arrows - move between windows; instead of arrows, the keys “J” (left), “K” (down), “L” (up) and “;” can also be used. (right);
  • Mod + Shift + Arrows - moving windows within the workspace; instead of arrows, letter keys and semicolons can also be used;
  • Mod + V - use vertical splitting;
  • Mod + H - use horizontal splitting (note that you can easily combine vertical and horizontal splitting, thanks to which you can achieve interesting effects);
  • Mod + E - default window placement (default layout);
  • Mod + S - stacking layout;
  • Mod + W - placement with tabs (tabbed layout);
  • Mod + F - expand the window to full screen or minimize it back;
  • Mod + Shift + Space - allow free movement of the window (floating mode) or return it to the mosaic;
  • Mod + Shift + R - restart i3 (for example, after updating the config);
  • Mod + Shift + E - exit i3;
i3 is configured through simple config files: ~/.i3/config and ~/.i3status.conf (hurray! no lua or rebuilding of sources!!!)

By the way, ~/.i3/config is obtained by copying from /etc/i3.. by default ~/.i3/config is missing.

$ cp /etc/i3status.conf ~/.i3/i2status.conf

Install xxkb and set it to autostart (exec in ~/.i3/config):

Exec xxkb &

We also install and enter the necessary applets for autorun:

Exec nm-applet & exec blueman-applet &

Then - the sound control keys:

# Volume settings bindsym XF86AudioRaiseVolume exec amixer -q sset Master 3%+ bindsym XF86AudioLowerVolume exec amixer -q sset Master 3%- bindsym XF86AudioMute exec amixer -q set Master toggle

In general, everything is clear there. In general, i3 is distinguished by rare usability and clarity of configs.

But this, as they say, “is not all.” The configs are well documented. Just look at http://i3wm.org/i3status/manpage.html (for starters: it describes, for example, how to use dzen2 with i3) and http://i3wm.org/docs/userguide.html to understand - it’s documented everything is good enough. Yes, and everything described in the documentation works!

  • If you want to try a tiling manager, then it makes sense to look at the i3 - it's at the moment, in my humble opinion, the simplest in terms of setup
  • We’ll have to “rebuild our head” a little. A tiling manager is another way of organizing PC-human interaction, whether we like it or not. Just different. More keyboard, less mouse. You can’t put a file on the desktop (and the desktop itself is so... very relative).
  • Nevertheless, it is possible to live, and quite comfortably. Although at first it seems - well, screw him! But if you experience this (to the point of “fingers remember”), then it becomes quite convenient.

Personally, I worked under i3 for about a week, went back (openbox and xfce panels), but I’m seriously thinking that on a netbook (an old 8" Sony, outrageously widescreen) i3 will be registered as the main manager... and, apparently, for a long time.



Loading...
Top