Guest bradenm Posted March 28, 2003 Report Share Posted March 28, 2003 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! Quote Link to comment Share on other sites More sharing options...
johnnyv Posted March 28, 2003 Report Share Posted March 28, 2003 oh yeah with xfree 4.3 we can have that cool penguin cursor. Quote Link to comment Share on other sites More sharing options...
manly Posted May 9, 2003 Report Share Posted May 9, 2003 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 Quote Link to comment Share on other sites More sharing options...
bvc Posted May 9, 2003 Report Share Posted May 9, 2003 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]$ Quote Link to comment Share on other sites More sharing options...
frosterrj Posted May 14, 2003 Report Share Posted May 14, 2003 Excellent!! Thanks for the script. I jsut put a link to it on my desktop, and am changing my cursors at will. Robert Quote Link to comment Share on other sites More sharing options...
Guest fubar::chi Posted May 14, 2003 Report Share Posted May 14, 2003 i don't think it's his script. I remember buchan asking me to test it (or something very similar) out on the cooker devel list Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.