Skip to content

Instantly share code, notes, and snippets.

@vphantom
Last active July 1, 2018 16:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vphantom/97d67328b55a1f1a11370a748da4dc03 to your computer and use it in GitHub Desktop.
Save vphantom/97d67328b55a1f1a11370a748da4dc03 to your computer and use it in GitHub Desktop.
Override Xorg's black hand1 mouse cursor pointer with the white hand2
#!/bin/sh
#
# Create ~/.fonts/, add cursor.pcf.gz and tell Xorg to use it.
#
# The included modified-cursor.pcf.gz was taken from Xorg's own cursor.pcf.gz
# and modified so that hand1 contains the same white hand as hand2.
#
# With this work-around, programs such as Google Chrome 57-58 and possibly
# Opera 44+ will continue to use the well-known left-pointing white pointer
# when hovering above hyperlinks.
#
# If you need to rebuild the file manually, here's what I did:
#
# * Copied it from /usr/share/fonts/X11/misc/
# * Decompiled it with pcf2bdf
# * Edit: line 3, change "-1" into "16"
# * Edit: the COPYRIGHT line has unescaped double quotes, remove to fix
# * Recompile with bdftopcf
#
mkdir ~/.fonts
cp modified-cursor.pcf.gz ~/.fonts/cursor.pcf.gz
mkfontdir ~/.fonts
xset +fp ~/.fonts
xset fp rehash
@houkensjtu
Copy link

Hi there! same problem here! I'm wondering where did you get the cursor.pcf.gz? Where is it typically located on a linux machine?
And could you explain why cursor theme is determined by a font directory? Because all the information I can find from internet says like this: https://wiki.archlinux.org/index.php/Cursor_themes
which does not mention your approach at all.
Cheers!

@vphantom
Copy link
Author

vphantom commented Jul 1, 2018

Oh wow, sorry @houkensjtu I never was notified of your message! I assume you figured something out since, but for sake of documenting it here, on my Debian system the file was /usr/share/fonts/X11/misc/cursor.pcf.gz. Here's how I modified it:

  • Decompile it with pcf2bdf;
  • Modify line 3, the "-1" must become "16";
  • Modify the COPYRIGHT line to remove the double quotes which were not escaped;
  • Recompile with bdftopcf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment