mastodon warning! may contain trace amounts of Lisp

xorg

Table of Contents

xmessage
like an echo for X.
  • Define the font using inside ~/.Xresources or ~/.Xdefaults: Xmessage*font: -*-terminus-*-*-*-*-*-*-*-*-*-120-*-u. (Then issue xrdb load ~/.Xresources to get that into effect.)
xfontsel
choose fonts
xsetroot
sets the background.
  • xsetroot -solid SteelBlue
xview
load images into an X11 window or onto the root window (cf. xloadimage, xsetbg)
xprop
property displayer for X
  • xprop -root|grep ^_NET_CLIENT_LIST. get window list.
xwininfo
window information utility for X
  • xwininfo -id 0x800003 – info from a particular window
xbiff
e-Mail
xclock
clock

1. quests

1.1. interacting via Common LISP

a fork of crhodes' fork of danb's fork of the CLX library, an X11 client for Common Lisp

https://github.com/sharplispers/clx

https://sharplispers.github.io/clx/Resources.html#Resources

1.1.1. list all fonts

(xlib:list-fonts (xlib:open-display "") "*")
(xlib:display-roots (xlib:open-display ""))
(xlib:list-extensions (xlib:open-display ""))
(describe (slot-value (car (xlib:display-roots (xlib:open-display "")))
                        'xlib::root))

;; xdotool search --name "Mozilla Firefox" windowsize 1280 720

(xlib:root-resources (car (xlib:display-roots (xlib:open-display ""))))
(xlib:global-pointer-position (xlib:open-display ""))  

1.1.2. the focused window

(xlib:input-focus (xlib:open-display ""))
(query-tree (xlib:input-focus (xlib:open-display "")))

1.1.3. window list

~(query-tree (slot-value (car (display-roots (xlib:open-display ""))) 'root))~

1.1.4. window name

(get-property
    (car (query-tree (slot-value (car (display-roots (xlib:open-display "")))
    'root)))
    :WM_NAME :type :string :result-type 'string :transform #'card8->char)

(defun window-name-get (window)
    (get-property window :WM_NAME :type :string :result-type 'string
    :transform #'card8->char))
(defun window-get-atoms (window)
    (get-property window :WM_NAME :type :string :result-type 'string
    :transform #'card8->char)))

(loop for each in
    (query-tree (slot-value (car (display-roots (xlib:open-display ""))) 'root))
    collect (window-name-get each))

(defconstant +predefined-atoms+
'#(nil :PRIMARY :SECONDARY :ARC :ATOM :BITMAP
  :CARDINAL :COLORMAP :CURSOR
  :CUT_BUFFER0 :CUT_BUFFER1 :CUT_BUFFER2 :CUT_BUFFER3
  :CUT_BUFFER4 :CUT_BUFFER5 :CUT_BUFFER6 :CUT_BUFFER7
  :DRAWABLE :FONT :INTEGER :PIXMAP :POINT :RECTANGLE
  :RESOURCE_MANAGER :RGB_COLOR_MAP :RGB_BEST_MAP
  :RGB_BLUE_MAP :RGB_DEFAULT_MAP
  :RGB_GRAY_MAP :RGB_GREEN_MAP :RGB_RED_MAP :STRING
  :VISUALID :WINDOW :WM_COMMAND :WM_HINTS
  :WM_CLIENT_MACHINE :WM_ICON_NAME :WM_ICON_SIZE
  :WM_NAME :WM_NORMAL_HINTS :WM_SIZE_HINTS
  :WM_ZOOM_HINTS :MIN_SPACE :NORM_SPACE :MAX_SPACE
  :END_SPACE :SUPERSCRIPT_X :SUPERSCRIPT_Y
  :SUBSCRIPT_X :SUBSCRIPT_Y
  :UNDERLINE_POSITION :UNDERLINE_THICKNESS
  :STRIKEOUT_ASCENT :STRIKEOUT_DESCENT
  :ITALIC_ANGLE :X_HEIGHT :QUAD_WIDTH :WEIGHT
  :POINT_SIZE :RESOLUTION :COPYRIGHT :NOTICE
  :FONT_NAME :FAMILY_NAME :FULL_NAME :CAP_HEIGHT
  :WM_CLASS :WM_TRANSIENT_FOR))

2. related reading


· © Edgard Bikelis (eſb) created using Emacs 29.0.50 (Org mode 9.5.4) ·
· created: 2020-03-05 last modified: 2022-07-30 ·