Docu review done: Wed 31 Jul 2024 02:41:09 PM CEST

x11-utils

Table of Content

General

An X client is a program that interfaces with an X server (almost always via the X libraries), and thus with some input and output hardware like a graphics card, monitor, keyboard, and pointing device (such as a mouse).

This package provides a miscellaneous assortment of X utilities that ship with the X Window System, including:

  • appres, editres, listres and viewres: which query the X resource database
  • luit: a filter that can be run between an arbitrary application and a UTF-8 terminal emulator
  • xdpyinfo: a display information utility for X
  • xdriinfo: query configuration information of DRI drivers
  • xev: an X event displayer
  • xfd: a tool that displays all the glyphs in a given X font
  • xfontsel: a tool for browsing and selecting X fonts
  • xkill: a tool for terminating misbehaving X clients
  • xlsatoms: which lists interned atoms defined on an X server
  • xlsclients: which lists client applications running on an X display
  • xlsfonts: a server font list displayer
  • xmessage: a tool to display message or dialog boxes
  • xprop: a property displayer for X
  • xvinfo: an Xv extension information utility for X
  • xwininfo: a window information utility for X

The editres and viewres programs use bitmap images provided by the xbitmaps package. The luit program requires locale information from the libx11-data package.

Installation

$ apt install x11-utils

xwininfo

This can be very helpful if you need to konw how build the select window is and at what position the top left corner is currently at.

xwininfo_data=$(xwininfo)
$ declare -A xwin_data=(
      ["x"]="$(awk -F: '/Absolute upper-left X/{print $2}' <<<"${xwininfo_data}")"
      ["y"]="$(awk -F: '/Absolute upper-left Y/{print $2}' <<<"${xwininfo_data}")"
      ["w"]="$(awk -F: '/Width/{print $2}' <<<"${xwininfo_data}")"
      ["h"]="$(awk -F: '/Height/{print $2}' <<<"${xwininfo_data}")"
  )

Now you have all the needed data in the xwin_data dictionary.

To access it, just do something like this:

$ echo "${xwin_data["x"]}"

$ for f in x y w h ; do echo "$f is ${xwin_data["${f}"]}" ; done