hacks=`cd /usr/lib*/xscreensaver/ && ls -1 | grep -v config` ;\
echo $hacks ;\
for name in $hacks; do \
	if test -f /usr/lib*/xscreensaver/$name && test -f /etc/xscreensaver/$name.xml && test ! -f ./ScreenSavers/$name.desktop; then \
	label=`grep '<screensaver.*_label' /etc/xscreensaver/$name.xml  | sed -e 's#^.*_label=\"\(.*\)\".*$#\1#'` ;\
	f=./ScreenSavers/$name.desktop ;\
	sed -e "s#@NAME@#$name#; s#@LABEL@#$label#" ./ScreenSavers/xscreensaver.template > $f; \
	if ldd /usr/lib*/xscreensaver/$name 2>&1 | grep libGL; then sed -e "s,@GL1@,X-KDE-Type=OpenGL,; s,@GL2@,X-KDE-Category=OpenGL Screen Savers," $f > $f.new && mv $f.new $f; else grep -v @GL $f > $f.new && mv $f.new $f; fi ;\
    fi; \
done
#
