Hello. I wrote a Compiz plugin to set the mouse cursor theme. I'm attaching the code here, but of course I'm open to resubmit it on launchpad or modify it as needed. My point here is mostly to discuss and show what I did, which might be controversial. Mouse themes would be conceptually simple: there is only a theme to select among the ones installed under /usr/share/icons (not all of which are necessarily *mouse* themes; only directories with a "cursors/" subdirectory count), and a cursor size. The libXcursor library accepts a theme name (which corresponds to a directory in /usr/share/icons or in $XCURSOR_PATH), and a cursor size in pixels; the size which is closest to the requested one is used. Of course only "well-behaved" program will obey our settings; each X application is free to use its own policy for setting cursors and disregard what we tell it. All modern large applications however do respond to cursor theme or size changes, normally using gsettings -- but each desktop environment has its own different schema; moreover GTK has its own way of specifying cursor themes in ~/.icons/default/index.theme , and old-school X applications (that I've ignored) use X resources instead. The main target for us at Hypra consists in low-vision users who are not necessarily technically minded, so we absolutely need a configuration GUI. CCSM is great, but its way of specifying options is not a perfect fit for the mouse theming problem. As far as I can see from the code the configuration of Compiz and its plugins is specified in XML (.in) files which contain the type, range and default values of each option. The XML files are used to generate C++ code holding configuration data structures, and also installed to be consulted at run time by CCSM. Differently from every other case I've seen, the mouse theme plugin needs to present a choice of one among a set of options which are only known at run time -- the currently installed mouse themes. The ideal way to do that would be with an option of type "int" and a _name subelement, which CCSM renders as nice combo boxes; but that won't work in our case because the set of installed themes would need to be specified in the XML file, which is much too early; the set of installed themes can change even after compiz is installed. My solution, which is admittedly kludgy, consists in specifying an option of type "list" where the first element is the one which is actually selected; the plugin C++ initialization code searches for the installed themes and fills the list at run time --- which is unfortunately not possible using a combo box without huge changes in the XSLT code generator and CCSM itself, as far as I can see. The dynamic initialization of the list, if naïvely performed at every plugin initialization as specified above, would override the user selection of her current theme. In order to prevent that I added a second option storing the set of *installed* themes (alphabetically sorted for normalization). The initialization code checks whether the actually installed themes have changed with respect to the saved value of the option; if not, the list of *selected* themes is not touched. This is clunky and it would be best to make the list of installed themes invisible to the user (I think that could be done with a new "invisible" type of hint to be specified in the XML file), but I find the current interface already not too terrible. I've uploaded a demo screencast at http://ageinghacker.net/scratch-hypra/mousetheme.webm . The user can also set a shell command line to actually set the theme for running applications, and of course the cursor size. The C++ code in Compiz is responsible for updating the cursor in the root window, for every screen. In order to make that cursor dynamically changeable I had to modify screen.h and screen.cpp, but that is not intrusive: Compiz only uses a "normal" and a "busy" cursor, so I simply added two methods setNormalCursor and setBusyCursor accepting a parameter of type Cursor. The window manager decorator is separate, and behaves as an ordinary process. What do you think of all this? I'm open to any suggestion. Thanks, -- Luca Saiu Hypra team (Accessible website in construction) -------------- next part -------------- A non-text attachment was scrubbed... Name: mousetheme-version-1.diff Type: text/x-diff Size: 58925 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/compiz/attachments/20150331/7ed2f65a/attachment-0001.diff>