A collection of tools for i3 that assist in window, workspace and output operations.

Overview

i3-valet

A collection of tools for i3 that assist in window, workspace and output operations. i3-valet can be run directly from the command line or as an i3 sidekick that listens for keybinding events over ipc.

Building & Installation

i3-valet is written in Rust and has only been tested against the latest stable version. It can be build with cargo build --release and the binary can be placed somehere in $PATH.

(note: this is still a newly public tool, if there's interest I'm glad to work with folks on better distribution)

Using i3-valet

i3-valet operates by running commands (called Actions). These actions will connect to i3-ipc and query information and then send commands back to i3. Whether run via keybinding in listen mode or from the cli, the actions have consistent names and arguments so you can test out what an action will do without having to muck with your i3config.

The available actions are:

  fix        clean up the window tree
  loc        Move A floating window to anchor point
  print      Print information about the current tree or window
  workspace  Workspace commands
  output     Movement between relative outputs
  layout     Window layout helpers

Information about actions and arguments can be found via the help subcommand, e.g.:

$ i3-valet help run output
Movement between relative outputs.

This assumes outputs are linear and cycles through them in order

Usage: i3-valet run output <CHANGE> <DIR>

Arguments:
  <CHANGE>
          Possible values:
          - move-ws:  move workspace to a different output
          - move-win: move workspace to a different output
          - focus:    focus a different output

  <DIR>
          [possible values: next, prev]

Options:
  -h, --help
          Print help information (use `-h` for a summary)

CLI

To run an action from the command line simply use i3-valet run <ACTION>. For example to focus the next output:

$ i3-valet run output focus next

Listen

Listen mode can be entered by running i3-valet listen. In this mode the program will connect to i3 and subscribe to keybind events. When an event for an i3-valet action arrives, it will do that action. Listen mode will exit the program if the connection to i3 is closed so it's recommended to run it from i3-config like this:

exec_always --no-startup-id i3-valet listen

So that if i3 is restarted i3-valet will also restart.

To configure keybindings use the nop command followed by an action just like the action on a command line. For example to configure a mode for moving floats using the loc action:

mode "move" {
    bindsym u     nop loc rel nw
    bindsym i     nop loc rel top
    bindsym o     nop loc rel ne
    bindsym n     nop loc rel sw
    bindsym m     nop loc rel bot
    bindsym comma nop loc rel se
}
bindsym $mod+m mode "move"

How it works The listen functionality takes advantage of the nop command in the i3 config

  • this command tells i3 that anything after the nop is to be ignored. When i3 creates events for pressed keybinding, it puts the entire command into the event anyway.

For example this binding in i3config:

bindsym $mod+t nop foo bar

will report nop foo bar as the command when $mod+t is pressed.

i3-valet just strips the nop from the command and parses it like it would from the command line.

Examples

TODO: Figure out how to record sessions highlighting various actions

Contributing

Contributions welome! Just open a PR or Issue and we can hash it out.

Areas where some help would be greatly appreciated:

  • Testing and fixing for sway
  • Doc improvements
  • New actions
You might also like...
Rust library that provides helpers for testing resilience of I/O operations.

partial-io Helpers for testing I/O behavior with partial, interrupted and blocking reads and writes. This library provides: PartialRead and PartialWri

NodeCraft - Crafting seamless node operations for distributed systems

NodeCraft Crafting seamless node operations for distributed systems, which provides foundational traits for node identification and address resolution

Provides a cross platform way to shut down, reboot or log out operations

@napi-rs/system-shutdown This package provides a cross platform way to shut down, reboot or log out operations. Supported platforms: Linux, Windows an

Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're working with files or directories, this tool simplifies common file operations with ease.

Rust FileOps Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're w

A small Rust library that let's you get position and size of the active window on Windows and MacOS

active-win-pos-rs A small Rust library that let's you get position and size of the active window on Windows and MacOS Build % git clone https://github

skyWM is an extensible tiling window manager written in Rust. skyWM has a clear and distinct focus adhering to the KISS and Unix philosophy.
skyWM is an extensible tiling window manager written in Rust. skyWM has a clear and distinct focus adhering to the KISS and Unix philosophy.

Please note: skyWM is currently in heavy development and is not usable as of yet. Documentation and versions will change quickly. skyWM skyWM is an ex

A library that creates a terminal-like window with feature-packed drawing of text and easy input handling. MIRROR.

BearLibTerminal provides a pseudoterminal window with a grid of character cells and a simple yet powerful API for flexible textual output and uncompli

Cross platfrom window and framebuffer crate for Rust

minifb is a cross platform library written in Rust and that makes it easy to setup a window and to (optional) display a 32-bit pixel buffer. It also m

A fully modular window manager, extremely extensibile and easily approachable.

AquariWM is a fully modular window manager, allowing extreme extensibility while remaining easily approachable. Installation AquariWM is currently in

Comments
  • Use tokio-i3ipc from crates.io

    Use tokio-i3ipc from crates.io

    After https://github.com/leshow/tokio-i3ipc/pull/43 is merged (or some other way of getting that info is available) fix Cargo.toml to use the upstream version instead of my pr repo.

    opened by sophacles 0
  • Exec in new workspace

    Exec in new workspace

    This would basicaly call the exec command after allocing a new workspace. This would largely just be a convenience thing because I think something like bindsym $mod+x nop workspace alloc; exec foo may be a race conditon on where the window for foo shows up.

    enhancement 
    opened by sophacles 1
  • Don't show usage and help in logs when command doesn't parse

    Don't show usage and help in logs when command doesn't parse

    Currently it outputs a log like this:

    [2022-12-27T16:40:37Z WARN  i3_valet] Error parsing action 'nop foo bar': error: The subcommand 'foo' wasn't recognized
    
    Usage: i3-valet <COMMAND>
    
    For more information try '--help'
    
    

    When a keybind that isn't an action is parsed. Get rid of everything but the first line.

    enhancement 
    opened by sophacles 0
Owner
Erich Heine
Erich Heine
Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other projects

Mercy ?? Documentation Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other pro

Umiko Security 2 Nov 27, 2022
Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other projects

Mercy ?? Documentation Mercy is a public Rust crate created to assist with building cybersecurity frameworks, assessment tools, and numerous other pro

CyberSuki 2 Nov 27, 2022
Codemod - Codemod is a tool/library to assist you with large-scale codebase refactors that can be partially automated but still require human oversight and occasional intervention

Codemod - Codemod is a tool/library to assist you with large-scale codebase refactors that can be partially automated but still require human oversight and occasional intervention. Codemod was developed at Facebook and released as open source.

Meta Archive 4k Dec 29, 2022
Zellij is a workspace aimed at developers, ops-oriented people and anyone who loves the terminal

Zellij is a workspace aimed at developers, ops-oriented people and anyone who loves the terminal. At its core, it is a terminal multiplexer (similar to tmux and screen), but this is merely its infrastructure layer.

null 9.3k Jan 4, 2023
⚙️ A curated list of static analysis (SAST) tools for all programming languages, config files, build tools, and more.

This repository lists static analysis tools for all programming languages, build tools, config files and more. The official website, analysis-tools.de

Analysis Tools 10.7k Jan 2, 2023
Utility to inherit dependencies from workspace file if it occurs 'n' or more times throughout the project.

Cargo Workspace Dependency Inheritor Utility that inherits dependencies from the main workspace if they occur n or more times in the workspace. Worksp

Timon 9 Oct 14, 2022
A gui tool written in Dioxus to make it easy to release a workspace of crates to crates.io

Easy-Release: a visual tool for releasing workspaces of libraries A work-in-progress GUI for releasing a large workspace of crates manually, but easil

Jon Kelley 13 Jan 18, 2023
A collection of semi-useful tools made for GNU/Linux

DECTOOLS A collection of semi-useful tools made for GNU/Linux. Some may work on macOS, though functionality isn't a priority. Depenencies: python, bas

Decator 3 Jun 8, 2022
A simple Rust library for OpenAI API, free from complex async operations and redundant dependencies.

OpenAI API for Rust A community-maintained library provides a simple and convenient way to interact with the OpenAI API. No complex async and redundan

null 6 Apr 4, 2023
A cli prepared with TUI that facilitates your operations.

⚠️ For linux only ⚠️ Helper CLI A cli prepared with TUI that facilitates your operations. Click me to learn more about the theme system. If you just w

Yiğit 4 Feb 1, 2022