Skip to main content

Various convenience functions to get json information similar to xwininfo

Project description

json-xwininfo

Get information about an X11 window in machine-readable JSON. This is similar to the xwininfo information

Installation

You can install this using pipx:

pipx install json-xwinfo

Usage

json-xwininfo

You can information about the currently focused window using:

json-xwininfo --focused

Most programming languages provides facilities to easily parse JSON. For using this information at the moment line you may wish to use the jq.

Alternatives and prior work

This tool is obviously inspired by xwininfo and at the moment wraps this tool and parses the output. This tool usings Xlib. You may prefer to use this library to obtain this information rather than using this tool for more "self-contained" pieces of software.

Motivation

I was experimenting with displaying information at particular positions on the screen - such as the top left corner of the window. The shell code necessary to do this was a little too involved to count as a good idea so I decided to wrap this into tool.

Caveats

Information is partial. At the moment this tool wraps xwininfo and parses the output.

Support

If you find this tool useful you can support it by giving me money on ko-fi. I would suggest a $1 dollar donation if you find this tool useful. This will incentivise me to create similar tools.

You may also like to look at my json-wmctrl which can be used to list and select windows and raise them.

You might like to read some of my writing about the note taking app Obsidian.

About me

I am @readwithai. I make tools related to reading, research and productivity sometimes with Obsidian.

You can follow me on X where I post about tools like this and a range of topics. Or if reading and research sounds interesting you could read my blog.

@readwithai logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

json-xwininfo-1.0.0.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file json-xwininfo-1.0.0.tar.gz.

File metadata

  • Download URL: json-xwininfo-1.0.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for json-xwininfo-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7972eb56217e74b27ec226afad80290e33c2bfc6da9cd29134edb36e7407c76e
MD5 b61732452b7eb615d56af85716eb277e
BLAKE2b-256 70c9db93ff2f43759c0debe9ed02d65922de1c6293b22217090ee24bbc2941c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page