window_titles is a small crossplatform utility crate with the only job of getting the titles of windows.
It supports:
- Linux / x11:
Using
xcbto query the x11 server. (Safe) - Windows:
Using
winapi. (Possibly Unsafe) - MacOS:
Using the
osascriptcommand. (Safe)
Usage is simple:
- Import both
ConnectionandConnectionTrait.
use window_titles::{Connection, ConnectionTrait};- Initiate the connection (Only Linux can return an error for this method).
let connection = Connection::new()?;- Get the window titles.
let titles: Vec<String> = connection.window_titles()?;