Skip to content

i3auto-ws-icons-rs listens for i3 events and updates workspace names to show icons for running programs

Notifications You must be signed in to change notification settings

madhur/i3auto-ws-icons-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

i3auto-ws-icons-rs

i3auto-ws-icons-rs listens for i3 events and updates workspace names to show icons for running programs. The icons can be configured by editing the config.toml configuration file.

  • Screenshot
    alt tag

  • Full window
    alt tag

Getting Started

Requirements for Compilation

The Rust compiler rustc, cargo package manager, C compiler gcc and libssl-dev packages are required to build the binary.

Compilation is only tested with very recent stable versions of rustc. If you use a distro with older Rust packages, consider using rustup to install a newer toolchain.

Build and Install from Source

$ git clone https://github.com/madhur/i3auto-ws-icons-rust
$ cd i3auto-ws-icons-rust
$ cargo install --path . --locked

By default, this will install the binary to ~/.cargo/bin/i3status-rs.

Integrate it into i3 / sway

The most preferred way is to run it with i3 configuration file and set it to start as startup as follows

exec_always --no-startup-id "$HOME/.cargo/bin/i3auto-ws-icons-rs"

The default i3 config's keybindings reference workspaces by name, which is an issue when using this script because the "names" are constantly changing to include window icons. Instead, you'll need to change the keybindings to reference workspaces by number.

Prefer

    bindsym $mod+1 workspace number 1

over

    bindsym $mod+1 workspace 1

Configuration

After installing i3auto-ws-icons-rust, edit the example configuration to your liking. The default location is $XDG_CONFIG_HOME/i3auto-ws-icons-rust/config.toml.

The configuration is driven through mapping of WM_CLASS of each window to the name of Font Awesome icon.

[icons] table:

Key Value Default
WM_CLASS of window Icon name of font-awesome *

The default icon can be changed through by updating the default_icon property

default_icon = '*'

The configuration comes with preset class names and icons for commonly used programs such as:

[[icons]]
alacritty = 'terminal'
kitty= 'terminal'
guake = 'terminal'
terminator = 'terminal'
firefox = 'firefox'
spotify = 'music'
slack = 'slack'
chromium = 'chrome'
code = 'file'
jetbrains-idea= 'code'
jetbrains-studio= 'code'
jetbrains-idea-ce= 'java'
"gimp-2.8"= 'image'

Any class names involving special characters such as hyphens and decimals should be enclosed in quotes as shown above. The class names are case insensitive.

Debugging

Run i3auto-ws-icons-rust in a terminal with the -v or --verbose parameter to check the logs. Attach the logs here along with the description if you encounter any issues.

Acknowledgements

This project borrows some ideas and inspirations from following awesome open source projects:

About

i3auto-ws-icons-rs listens for i3 events and updates workspace names to show icons for running programs

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages