i3-focus-last

Crates.ioi3-focus-last
lib.rsi3-focus-last
version0.5.4
sourcesrc
created_at2018-11-23 09:06:17.046477
updated_at2022-08-09 20:30:07.664619
descriptionFocus last window on i3
homepage
repositoryhttps://github.com/lbonn/i3-focus-last
max_upload_size
id98255
size18,783
(lbonn)

documentation

README

i3-focus-last

Crate

Another implementation of this classic (and useful) example of i3 ipc use.

Works on reasonable versions of i3 and sway >= 1.2.

Done in rust:

  • for fun!
  • it's compiled, so we won't suffer from the overhead of starting a new interpreter for each client (the python version I used was sluggish at times, for this reason)

Usage

Add this line to your i3 or Sway configuration:

exec_always i3-focus-last server

Then, add a binding to execute i3-focus-last:

bindsym $mod+Tab exec i3-focus-last

Menu mode

i3-focus-last can be used with rofi to display a window switcher menu in which the entries are sorted by focus order.

To launch it, just run i3-focus-last menu when the server is running (or bind it to some key combination).

It can also shows icons corresponding to the window class or app_id. This mapping can be customized by modifying ~/.config/i3-focus-last/icons.json. For example:

{
  "Alacritty": "terminal",
  "firefox": "firefox",
  "Chromium": "chromium"
}

The values in the dictionary should be names of icons in /usr/share/icons/**.

Commit count: 50

cargo fmt