Am Montag, 10. M�rz 2003, 19:19:51 Uhr MET, schrieb Buchan Milne:
> So, I hacked up a short bash script, but I would like some testers.
> Requires gtkdialogs. Should be able to choose any cursor theme in
> /usr/share/icons, and may also work for themes the user has in ~/.icons.
Hi,
I've fixed a few bugs, see the attached patch. It will check the
existance of the ~/.icons/default/index.theme and create it if needed.
Also the return code checking from grep was fixed. The replacement of
the theme name should be a bit more robust now in case of a broken
index.theme (by overwriting instead of appending to the file).
But I still have a problem with this tool: Maybe it would be better to
set the cursor theme with the X ressource (XCursor.theme), because I
don't think the cursor themes support recursive inheritation. If you
create a cursor with the sd2xc script (in contribs), it will inherit
the whiteglass theme for missing cursor images. If you configure the
cursor with your script, you will have this:
~/.icons/default/index.theme:
[Icon Theme]
Inherits=Simpleblau
~/.icons/Simpleblau/index.theme:
[Icon Theme]
Inherits=Whiteglass
And AFAIK this will not work.
--
G�tz Waschk <> master of computer science <> University of Rostock
http://wwwtec.informatik.uni-rostock.de/~waschk/waschk.asc for PGP key
--> Logout Fascism! <--
--- choose_cursor Tue Mar 11 09:54:54 2003
+++ choose_cursor.gpw Mon Mar 10 20:55:30 2003
@@ -19,14 +19,18 @@
INDEX=$ICONS/$INDEXFILE
else
INDEX=$USERICONS/$INDEXFILE
+ if [ ! -d $USERICONS/default ]; then
+ mkdir -p $USERICONS/default
+ touch $INDEX
+ fi
fi
grep -q "\[Icon Theme\]" $INDEX 2>/dev/null
-if [ $? ]
+if [ $? -eq 0 ]
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 "[Icon Theme]" > $INDEX
echo "Inherits=$THEME" >> $INDEX
fi