Skip to content

Commit

Permalink
refactor: replace xcb with i3ipc window_properties
Browse files Browse the repository at this point in the history
This refactor uses my fork of i3ipc-rs, which includes a fix that makes
i3ipc-rs return the correct window_properties, which includes class,
instance, and name/title. This makes XCB no longer needed as a
dependency, which in turn makes the encoding handling unneeded.

Reason I use my own fork, instead of a PR is that the upstream i3ipc-rs
lib hasn't been updated for a while, and there are a multitude of PR
requests that goes unhandled, including a fix for my own issue. Will
dispatch of my own fork if things get moving again.

wip: use local i3ipc package

wip

wip: setup testing functions

wip: get props

wip: parse props

Add log crate, use git source for i3ipc

I did a quick fix for an issue with window_properties

wip new filtering logic

refactor: add proof of concept _get_title impl

refactor: cleanup old code + deps

wip: tests
  • Loading branch information
roosta committed Nov 11, 2023
1 parent 5abc4e0 commit a80e19b
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 226 deletions.
89 changes: 1 addition & 88 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ exclude = ["/script", "/assets/*", "Vagrantfile"]
travis-ci = { repository = "roosta/i3wsr" }

[dependencies]
xcb = "1.2.1"
clap = { version = "4.3.11", features = ["derive"] }
toml = "0.7.6"
serde = { version = "1.0.171", features = ["derive"] }
itertools = "0.11.0"
regex = "1.9.1"
encoding = "0.2.33"
dirs = "5.0.1"
i3ipc = "0.10.1"
# log = "0.4"

[dependencies.i3ipc]
git = 'https://github.com/roosta/i3ipc-rs'
# path = "../i3ipc-rs"
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,9 @@ property for each window in a workspace. In action it would look something like
![](https://raw.githubusercontent.com/roosta/i3wsr/main/assets/preview.gif)
## Requirements

i3wsr requires [XCB](https://xcb.freedesktop.org/), if you get compilation
errors mentioning `xcb`, you might need to install `libxcb`. On Ubuntu for
example you'd install:

```sh
sudo apt-get install libxcb1-dev
```

Refer to [#18](https://github.com/roosta/i3wsr/issues/18) for more.

i3wsr requires [i3wm](https://i3wm.org/) and [numbered
workspaces](https://i3wm.org/docs/userguide.html#_changing_named_workspaces_moving_to_workspaces),
see [i3-configuration](#i3-configuration)

## Installation

Expand Down Expand Up @@ -85,7 +78,7 @@ exec_always --no-startup-id $HOME/.cargo/bin/i3wsr
exec_always --no-startup-id /usr/bin/i3wsr
```

## i3 configuration
## i3-configuration

This program depends on numbered workspaces, since we're constantly changing the
workspace name. So your I3 configuration need to reflect this:
Expand Down Expand Up @@ -333,8 +326,9 @@ To run tests locally [Vagrant](https://www.vagrantup.com/) is required. Run
`script/run_tests.sh` to run tests on ubuntu xenial.

## Attribution

This program would not be possible without
[i3ipc-rs](https://github.com/tmerr/i3ipc-rs), a rust library for controlling
i3-wm through its IPC interface and
i3wm through its IPC interface and
[rust-xcb](https://github.com/rtbo/rust-xcb), a set of rust bindings and
wrappers for [XCB](http://xcb.freedesktop.org/).
2 changes: 1 addition & 1 deletion script/vagrant_root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# Install needed packages
apt-get update
apt-get install -y i3-wm gcc gpick xterm xvfb libxcb1-dev
apt-get install -y i3-wm gcc gpick xterm xvfb
Loading

0 comments on commit a80e19b

Please sign in to comment.