| 1 | #! /bin/bash |
| 2 | # |
| 3 | # bin/link-cursors |
| 4 | # Part of ComixCursors, a desktop cursor theme. |
| 5 | # |
| 6 | # Copyright © 2010–2013 Ben Finney <[email protected]> |
| 7 | # Copyright © 2006–2013 Jens Luetkens <[email protected]> |
| 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 | |
| 22 | # Create cursor name symlinks. |
| 23 | |
| 24 | cursordir="$1" |
| 25 | |
| 26 | linksfile="cursorlinks" |
| 27 | |
| 28 | sed -e 's/#.*$//' "${linksfile}" \ |
| 29 | | grep -v '^[[:space:]]*$' \ |
| 30 | | (cd "${cursordir}" ; |
| 31 | while read orig new ; do |
| 32 | if [ $VERBOSE ] ; then |
| 33 | printf "Creating symlink of %s at %s\n" "$orig" "$new" ; |
| 34 | fi |
| 35 | ln -sf "$orig" "$new" ; |
| 36 | done) |