Skip to main content

Various convenience functions to get json information similar to xwininfo

Project description

json-xwininfo

@readwithai - X - blog - machine-aid reading

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.1.0.tar.gz (4.2 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: json-xwininfo-1.1.0.tar.gz
  • Upload date:
  • Size: 4.2 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.1.0.tar.gz
Algorithm Hash digest
SHA256 5d674f144a39af21fad95a7f861af01e832fd3e475681bc051bdb0d21fe986ce
MD5 91263cfbc46a9d085a0089a338efa5b6
BLAKE2b-256 78c2547708ed12056cf5138474fb66f3d28a0fde12cd52d77ff952bfd79d5eb7

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