Jump to content

Xfree 8.6 and changing cursors


Guest bradenm
 Share

Recommended Posts

Guest bradenm

Until the next version of KDE and Gnome come out, you can use the following script to choose and change mouse cursors in Xfree86 4.3:

 

Save the following (as root) to /usr/bin/choose_cursor :

#!/bin/bash

#

# Script for change cursors in XFree86 4.3 and up

#

# By Ranger <buchanmilne@netscape.net>, ranger.dnsalias.com

# and Braden MacDonald <bradenm_k@shaw.ca>



ICONS=/usr/share/icons

USERICONS=~/.icons

INDEXFILE=default/index.theme



c=(`ls $ICONS/*/cursors $USERICONS/*/cursors -d 2>/dev/null|cut -f5 -d'/'|grep -v default`)



BUTTONS=`for i in $(seq 0 "$[${#c[*]}-2]");do echo -n "$i ${c[i]} ";done``echo -n "${c[$[${#c[*]}-1]]}:$[${#c[*]}-1]"`



MESSAGE="Choose a cursor. You change will take effect in all newly started applications."



THEME=${c[`kdialog --menu "$MESSAGE" $BUTTONS`]}

#THEME=${c[$?]}



if [ $? -eq 0 ];then

       # Root sets the global cursor

       if [ `id -u` -eq 0 ];then

               INDEX=$ICONS/$INDEXFILE

       else

               INDEX=$USERICONS/$INDEXFILE

       fi



       grep -q "[Icon Theme]" $INDEX 2>/dev/null

       if [ $? ]

       then

               cp -f $INDEX $INDEX.backup 2>/dev/null

               cat $INDEX.backup |sed -e "s/^Inherits=.*$/Inherits=$THEME/g" >$INDEX

       else

               echo "[Icon Theme]" >> $INDEX

               echo "Inherits=$THEME" >> $INDEX

       fi



       if [ "$DESKTOP" = "kde" ];then

               #dcop kwin MainApplication-Interface quit

               #kstart kwin &

               # Remove the comment characters (#) from the above lines to have the mouse cursor change (with out logging out) over all window decorations, borders, etc.  I have it commented because I find that it disrupts your window layout and takes about 7 seconds with no window manager, which is ugly.

               dcop kicker kicker restart &

               if [ -x /usr/bin/kdekillall ];then

                       kdekillall kdesktop

                       kstart kdesktop &

               fi

       fi

fi

 

You will then need to run the command "chmod +x /usr/bin/choose_cursor" as root. I also recommend using menudrake and giving it a menu entry.

 

Now, as a regular user, simply run the command "choose_cursor".

 

Now go here and get some cursors!

Link to comment
Share on other sites

  • 1 month later...

I'm confused as to how the directory layout for cursors should be. Should I have a separate folder for each cursor in the ~/.icons directory?

 

--Andrew

Link to comment
Share on other sites

yes

[bvc@localhost bvc]$ ls -a .icons

./               Crystal-Red/      Slick/         innerspace/

../              Crystal-Violet/   Snow-Apple/    pkgs/

3dwhite/         Crystal-Yellow/   aquadiz/       red_shadow/

Beos/            CursorCraft/      black_shadow/  stylish/

Blue/            Gentoo-test/      blue_shadow/   white_shadow/

Crystal/         Noia/             cursor_mix/    ximian-south/

Crystal-Green/   ScalableGorilla/  gold/          yellow_shadow/

Crystal-Orange/  Silver/           green_shadow/

[bvc@localhost bvc]$

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...