How to set linux wallpaper using clx

90 views Asked by At

I'm trying changing wallpaper using clx, but it do not work. What is wrong with my code?

(ql:quickload :clx)

(defpackage #:wm/uw
  (:use #:cl #:xlib))

(in-package #:wm/uw)

(setf *display* (open-default-display))

(setf *screen* (display-default-screen *display*))

(setf *root* (screen-root *screen*))

(setf (window-background *root*) (screen-white-pixel *screen*))

(clear-area *root*)
(close-display *display*)


1

There are 1 answers

0
H. Rittich On

To improve network performance, many X11 client libraries do not directly execute X11 commands. Instead, the commands are stored and sent in batches to the XServer. Usually, this happens automatically before event handling. Since you are doing no event handling, it seems that the command queue is never flushed. If you execute

(xlib::buffer-flush *display*)

before closing the display, you should see the desired effect. CLX does not export the buffer-flush function, hence you need to explicitly state the package name.