link-cursors 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #! /bin/bash
  2. #
  3. # bin/link-cursors
  4. # Part of ComixCursors, a desktop cursor theme.
  5. #
  6. # Copyright © 2010–2013 Ben Finney <ben+opendesktop@benfinney.id.au>
  7. # Copyright © 2006–2013 Jens Luetkens <j.luetkens@limitland.de>
  8. #
  9. # This work is free software: you can redistribute it and/or modify it
  10. # under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation, either version 3 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This work is distributed in the hope that it will be useful, but
  15. # WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. # General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with this work. If not, see <http://www.gnu.org/licenses/>.
  21. # Create cursor name symlinks.
  22. cursordir="$1"
  23. linksfile="cursorlinks"
  24. sed -e 's/#.*$//' "${linksfile}" \
  25. | grep -v '^[[:space:]]*$' \
  26. | (cd "${cursordir}" ;
  27. while read orig new ; do
  28. if [ $VERBOSE ] ; then
  29. printf "Creating symlink of %s at %s\n" "$orig" "$new" ;
  30. fi
  31. ln -sf "$orig" "$new" ;
  32. done)