Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

  1. #1
    Join Date
    Dec 2011
    Beans
    Hidden!

    Thumbs up HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

    [edit: this started off as a failproof how-to but turned out to have slings and traps. if this first post works for you, fine. otherwise you might want to start here.]

    problem: changing mouse pointers (cursor themes) does not work under xubuntu/xfce.
    usually changing the theme from xfce4-settings-manager takes effect in firefox and other apps, but when moving the pointer onto window decorations it reverts to the default theme.

    searching on the net shows that this problem has been around for years, and still is, and there's dozens of fixes/half-solutions/requests around.

    here's one that works on my regular xubuntu distro (11.10) with xfce 4.8 - and believe me, i've been trying all kinds of things, logging out and in after every change, rebooting many times... this one is 100% - at least on my setup - and i just feel that it's worth sharing.

    here it comes:

    You change the cursor theme from xfce4-settings-manager -> Mouse -> Theme.
    then you find a file called .Xdefaults in your home folder. probably it will have an entry:
    Code:
    Xcursor.theme: PolarCursorTheme # or whatever you have there
    if not, put it there.
    change that name to your new cursor theme as named in the settings-manager.

    Now you have to REBOOT (logging out and in is NOT enough!) and after that you should have your desired cursor theme everywhere. if not, try this:

    - have your cursor themes in /usr/share/icons instead of ~/.icons
    - make sure they have the proper permissions and ownership, and make sure all the files have them. if not apply them recursively (usually read and write for root, read only for all others) for the whole folder.
    - make sure the theme name inside index.theme matches the name in your .Xdefaults (additionally, it's surely safest if the theme has exactly the same name as the folder it's in)
    - if you made changes, reapply the theme from settings-manager (change to a different theme and back to the one you want) and REBOOT again.

    enjoy!

    PS: lots of cursor themes from gnome-look.org - or xfce-look.org. - section X11 mouse themes

    PPS: I haven't updated for a couple of months; if this has been fixed, please let me know.
    Last edited by ohnonot; May 12th, 2012 at 11:38 AM.

  2. #2
    Join Date
    Dec 2011
    Beans
    Hidden!

    Re: HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

    edit:
    i just found out that i had login set to autologin while i did all this experimenting;
    i just proved empirically that when i unset the autologin (that's in /etc/lightdm/lightdm.conf for xubuntu, setting autologin-user= (meaning nil))
    the greeter somehow changes the mouse pointer to the default pointer.
    i tried adding the same line as in .Xdefaults to the lightdm-gtk-greeter.conf but it doesn't help.
    there is still one option to set the "ancient" default cursor with this:
    Code:
    sudo update-alternatives --config x-cursor-theme
    - but i don't know how to add themes to that list.
    for me it's not a biggie because i use autologin if i'm not digging deep inside the bowels of my OS - for you it mayb is.

    so if someone knows how to add cursor themes to the list provided by this:
    Code:
    sudo update-alternatives --config x-cursor-theme
    - i'd be happy to know!

  3. #3
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

    Try this:
    Code:
    sudo update-alternatives --install /etc/alternatives/x-cursor-theme x-cursor-theme /usr/share/icons/<Cursor> 51
    ...where <Cursor> is the name of the cursor directory and
    ...51 is the priority.

  4. #4
    Join Date
    Oct 2008
    Beans
    3,509

    Re: HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

    I found that editing 2 settings when changing the mouse cursor makes
    the change consistent.
    Code:
    gsettings set org.gnome.desktop.interface cursor-theme "$CURSOR" &
    	sudo ln -fs /usr/share/icons/$CURSOR/cursor.theme /etc/alternatives/x-cursor-theme
    ...where $CURSOR is your cursor-theme name.

    I wrote this which will list your cursor-themes in /usr/share/icons
    allowing you to chose your theme and run the above commands with the option to restart lightdm.

    Save as change_cursor and make executable.
    Code:
    #!/bin/bash
    
    ### Script to change cursors in /usr/share/icons ###
    
    #
    ## create installed cursor list text file
    ls -R /usr/share/icons | grep "\/cursors:" | sed -e 's/\/cursors://g' -e 's/\/usr\/share\/icons\///g' > ~/.cursorlist.txt
    
    # 
    ## show a numbered list of cursors to choose from
    cat -b ~/.cursorlist.txt 
     
    	echo -e "\033[36mEnter your theme selection number:\033[0m"
    	read CHOICE
    
    #
    ## match the theme selection number to the cursor name
    CURSOR=$(cat ~/.cursorlist.txt | sed -n $CHOICE'p') 
    	echo -e "\n\033[36mYou have selected ...$CURSOR\nContinue?(y/n):\033[0m"
    	read Ans
    if  [ "$Ans" != "y" ]; then
    exit
    else
    
    #
    ## Change to selected  cursor ###
    	gsettings set org.gnome.desktop.interface cursor-theme "$CURSOR" &
    	sudo ln -fs /usr/share/icons/$CURSOR/cursor.theme /etc/alternatives/x-cursor-theme
    	#sudo sh -c "echo '[Icon Theme]\nInherits=$CURSOR' > /usr/share/icons/DMZ-White/cursor.theme"
    fi
    
    #
    ## Restart session to complete cursor change ###
    	read -p "Do you wish to restartx? Save any work as you will now be logged out.(y/n):"
    if  [ "$REPLY" != "y" ]; then 
    	echo -e "\033[36m\nYou need to log out to complete cursor change.\033[0m";
    else 
    	sudo service lightdm restart
    fi
    To run click on change_cursor and choose to Run in Terminal.


    ***I have downloaded some themes which do not include a cursor.theme file.
    You will need to create one for that theme for the script to work
    Look in /usr/share/icons/DMZ-White/cursor.theme for the correct format.

  5. #5
    Join Date
    Dec 2011
    Beans
    Hidden!

    Re: HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

    i messed it up.
    stinkeyes script gives this message:
    Code:
    Enter your theme selection number:
    3
    
    You have selected ...ATER
    Continue?(y/n):
    y
    [sudo] password for holy: 
    ln: accessing `/etc/alternatives/x-cursor-theme': Too many levels of symbolic links
    Do you wish to restartx? Save any work as you will now be logged out.(y/n):
    ...and doesn't change anything.
    my
    Code:
    sudo update-alternatives --config x-cursor-theme
    returns another error:
    Code:
    update-alternatives: using /usr/share/icons/ATER to provide /etc/alternatives/x-cursor-theme (x-cursor-theme) in manual mode.
    update-alternatives: error: unable to install /etc/alternatives/x-cursor-theme.dpkg-tmp as /etc/alternatives/x-cursor-theme: No such file or directory
    and toz's command - no error, but no effect either

  6. #6
    Join Date
    Aug 2009
    Location
    Under the stairs.
    Beans
    1,408
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

    You don't actually need the script to accomplish this although it is very handy. you can simply write the name of the cursor theme in /etc/alternatives/x-cursor-theme.

    Code:
    sudo gedit /etc/alternatives/x-cursor-theme
    Next to Inherits=put the theme name here. Save log out/in and it will be changed....just another way.
    Dell Inspiron 1764 Laptop, Intel CoreTM i5 520M), 4GB Shared Dual Channel DDR3 at 1066MHz, 512MB ATI Mobility RadeonTM HD4330 Integrated Intel HD.

  7. #7
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

    Quote Originally Posted by ohnonot View Post
    and toz's command - no error, but no effect either
    After running that command, try running:
    Code:
    sudo update-alternatives --config x-cursor-theme
    ...to set the cursor theme.

  8. #8
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    3,712

    Re: HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

    Quote Originally Posted by ohnonot View Post
    and toz's command - no error, but no effect either
    A little analysis:

    First of all, x-cursor-theme in the /etc/alternatives directory is a symbolic link.

    Now, from the man page for update-alternatives, here is the syntax and definition of terms of the install option:

    update-alternatives --install link name path priority

    ...link is the generic name for the master link, name is the name of its symlink in the alternatives directory, and path is the alternative being introduced for the master link.
    the target of link is name (in the alternatives directory) and the target of name is path. (Note: in an actual command, path would be replaced by the complete path to the cursor.theme file in the new cursor's folder.)

    if link is set as /etc/alternatives/x-cursor-theme, and name as x-cursor theme, realize that this makes link = name since the second argument of the command is by definition in /etc/alternatives.

    The command will just be ignored and the new cursor is not installed into the alternatives, as a symlink cannot have two targets (x-cursor-theme pointing to both path and itself.) Obviously, also not a good practice to link a symbolic link to itself.
    Last edited by Dennis N; May 12th, 2012 at 04:04 AM. Reason: added clarification.

  9. #9
    Join Date
    Feb 2011
    Location
    Somewhere...
    Beans
    1,557
    Distro
    Ubuntu 14.10 Utopic Unicorn

    Re: HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

    Quote Originally Posted by Dennis N View Post
    A little analysis:

    First of all, x-cursor-theme in the /etc/alternatives directory is a symbolic link.

    Now, from the man page for update-alternatives, here is the syntax and definition of terms of the install option:

    the target of link is name (in the alternatives directory) and the target of name is path. (Note: in an actual command, path would be replaced by the complete path to the cursor.theme file in the new cursor's folder.)

    if link is set as /etc/alternatives/x-cursor-theme, and name as x-cursor theme, realize that this makes link = name since the second argument of the command is by definition in /etc/alternatives.

    The command will just be ignored and the new cursor is not installed into the alternatives, as a symlink cannot have two targets (x-cursor-theme pointing to both path and itself.) Obviously, also not a good practice to link a symbolic link to itself.
    This +1


    I have tried various method to change the cursor theme and make it consistent; none works except for this: remove the "default" folder in /usr/share/icons, and make "default" a symlink to the folder of the cursor theme, log out and log in. Done. Simple. Fast. No tampering with /etc/alternatives/x-cursor-theme needed.
    (it's 2012 and a dirty hack is still required to make the cursors on Firefox and the desktop and the window borders look similar. What The Chuck?)

  10. #10
    Join Date
    Dec 2011
    Beans
    Hidden!

    Re: HowTo: Change Mouse Cursor or Pointer Themes globally and persistently.

    wow, so many answers!
    first of all:
    Quote Originally Posted by zombifier25 View Post
    I have tried various method to change the cursor theme and make it consistent; none works except for this: remove the "default" folder in /usr/share/icons, and make "default" a symlink to the folder of the cursor theme, log out and log in. Done. Simple. Fast. No tampering with /etc/alternatives/x-cursor-theme needed.
    (it's 2012 and a dirty hack is still required to make the cursors on Firefox and the desktop and the window borders look similar. What The Chuck?)
    - i agree with your complaint!
    apart from that, i think the setting in ~/.Xdefaults has priority over /usr/share/icons/default.
    anyhow, it doesn't solve the problem to make the cursor theme persistent throughout major changes in the session. that's a foggy way of saying it, i know.
    if i can influence the cursor theme as it looks before i log in, then it's pretty persistent i would say.
    of course i then still have to set the right cursor theme for the desktop environment.

    it seems that the solution is found here.

    a HUGE thanks to Dennis N who set me off in the right direction.
    i think you not only took the time to read the whole thread but also to analyse all the half-truths and errors, including, of course, my own.

    having said that, i am as thankful to everyone else.


    Quote Originally Posted by Toz View Post
    Try this:
    Code:
    sudo update-alternatives --install  /etc/alternatives/x-cursor-theme x-cursor-theme  /usr/share/icons/<Cursor> 51
    ...where <Cursor> is the name of the cursor directory and
    ...51 is the priority.
    - so this would be the WRONG version which is surprisingly wide spread on the internet. or maybe it works on some systems?!

    next: how do i remove items from the list i get with
    Code:
    sudo update-alternatives --config x-cursor-theme
    ???
    Last edited by ohnonot; May 12th, 2012 at 03:51 PM. Reason: corrected link "the solution is found here"

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •