This question has two parts:
How to install an x-cursor-theme in Ubuntu via a bash shell script. The cursor theme is not expected to be in the repositories.
How to actually make the new theme become fully active. There is a bug in Ubuntu where the (GUI selected) x-cursor theme will not be used for Java applications (and other special applications) unless one goes through the additional step of selecting the theme via:
update-alternatives --config x-cursor-theme
Ideally, would like to script that step too so the process is fully automated.
For example, I would like to install the opaque comix cursor theme via a script. I need these two files to get started:
wget -O /tmp/ComixCursors-0.7.3.tar.bz2 http://www.limitland.de/comixcursors/ComixCursors-0.7.3.tar.bz2 wget -O /tmp/ComixCursors-Opaque-0.7.3.tar.bz2 http://www.limitland.de/comixcursors/ComixCursors-Opaque-0.7.3.tar.bz2
Note that the installation instructions provided at gnome-look.org are not appropriate for Ubuntu/Mint/Debian. I will paste them below. But I want to do this the proper way for Ubuntu, which, as far as I understand it, would use theme files and symlinks (the details of which I haven't figured out).
Non-Ubuntu System Installation
For system-wide installation you need to copy the cursor- directories to you X11 lib directory. Issue these commands::
$ whereis X11 $ man 3 xcursor $ cd /usr/share/icons $ sudo cp -r ~/.icons/ComixCursors* .
Now this will interfere with the cursor theme in your ~/.icons directory, which will have precedence. You will want to rename the cursors directory and edit the index.theme file inside.
If you want to make this theme the system-wide default, edit the file /etc/sysconfig/windowmanager to read::
X_MOUSE_CURSOR="ComixCursors-White-Regular-Slim" or whatever your (custom) cursors directory is named.