8000 GitHub - Cretezy/i3-back at v0.3.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

An i3/Sway utility to switch focus to your last focused window. Alt+Tab in i3

License

Notifications You must be signed in to change notification settings

Cretezy/i3-back

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

i3-back

An i3/Sway utility to switch focus to your last focused window. Allows for behavior similar to Alt+Tab on other desktop environments.

Features:

  • Can switch between your 2 most recent windows
    • Runs a daemon (background process) to listen for focus changes and sets a mark
  • Supports i3 and Sway
  • Supports floating windows
  • Can be binded to any key through i3's bindsym

Demo

2023-02-25.18-32-33.mp4

Installation

i3-back requires i3/Sway. It is written in Rust. It can be installed through many method:

  • Cargo (Rust's package manager) package:

    cargo install i3-back
    
  • Arch Linux from the AUR (i3-back-bin):

    yay -S i3-back-bin # Or with paru or other AUR wrappers
    # Or manually: https://wiki.archlinux.org/title/Arch_User_Repository#Installing_and_upgrading_packages
    
  • Debian/Ubuntu as a deb from GitHub releases

  • Binary from GitHub releases

Setup

In your i3/Sway configuration (~/.config/i3/config/~/.config/sway/config):

# Start the daemon which listens to focus changes and sets _back mark
exec --no-startup-id ~/.cargo/bin/i3-back

# Bind a switch key, which focuses the previously focused window
bindsym $mod+Tab [con_mark=_back] focus

Replace ~/.cargo/bin with wherever the i3-back binary is placed if not installed through Cargo.

How it works

The daemon (i3-back) listen for i3 window events. When a window event is received, i3-back records the previously focused window ID. When the previous focus has changed, it sets the _back mark.

When the switch bind is called, it focuses the mark set by the daemon.

Prior work

About

An i3/Sway utility to switch focus to your last focused window. Alt+Tab in i3

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages

0