A command-line utility that helps you bind keys to find and display a window, or open it if there is no instance running in i3wm.
Project description
i3-find-or-open
This repo provides a command-line tool: i3-find-or-open
that can find a window by regex in your i3wm instance, and display it, or execute any command if it is not open.
It is intended to help you bind keys that will reliably show you a program, whether or not it is open already, but technically it is capable of showing you any window, and running an arbitrary command if it is not open.
Installation
i3-find-or-open is available on PyPI, and the best way to install it (if you don't want to break your system python installation) is to use pipx (N.B. there is an Arch package python-pipx
to install this with).
pipx install i3-find-or-open
Note that if you want to bind keys in i3 to this program, it will need to be installed for all users:
sudo PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install i3-find-or-open
Usage
Let's say I wanted to use this to bind $mod+o
to open my Obsidian vault (called "vault"):
bindsym $mod+o exec --no-startup-id "i3-find-or-open '^.* - vault - Obsidian v([1-9]|\.)+$' 'obsidian'"
It's worth noting that the title regex you use will usually have to be quite specific when running from a command line, as the title of your terminal emulator will likely include the full command string (make use of ^
, and $
tokens where possible).
Some other examples:
bindsym $mod+t exec --no-startup-id "rm ~/icl/.~lock.timetable.ods#; i3-find-or-open 'timetable\.ods — LibreOffice Calc' 'libreoffice --norestore ~/icl/timetable.ods'"
bindsym $mod+q exec --no-startup-id "i3-find-or-open 'qBittorrent' 'qbittorrent'"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for i3_find_or_open-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bde3563e4f5170fe452e18bb5038320b609e61841d3407eacf15c85cce1c2fc |
|
MD5 | 271d5de90bea8013999f904c3aa9b097 |
|
BLAKE2b-256 | 615429aa0e361cd8080b6ba4301b956cb4c38194a5ac19a800c334ea879f73cd |