#!/bin/bash
##
# Copyright : (C) 2007 cyberorg
# E-mail : cyberorg (at) cyberorg.info
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#This is a script to run xscreensaver as animated background in Xgl
#Get xwinwrap before using this script
#
#-g = parse geometry
#-ni = no input
#-argb = argb visual
#-fs = full screen
#-s = sticky
#-st = skip taskbar
#-sp = skip pager
#-a = above
#-b = below
#-nf = no focus
#-o OPACITY
#
##
ARCH=`arch`
if [ $ARCH == "i686" ]; then
SAVERPATH=/usr/lib/xscreensaver
elif [ $ARCH == "x86_64" ]; then
SAVERPATH=/usr/lib64/xscreensaver
fi
while true; do
ls $SAVERPATH
echo "Select your cool background:"
read background
bg=$background
echo -n "Want to run in foreground? (y/n) "
read yn
case $yn in
y* | Y* ) xwinwrap -ni -argb -fs -s -st -sp -nf -- $SAVERPATH/$bg -root -window-id WID; break ;;
[nN]* ) xwinwrap -ni -argb -fs -s -st -sp -b -nf -- $SAVERPATH/$bg -root -window-id WID; break ;;
q* ) exit ;;
* ) echo "unknown response. Asking again" ;;
esac
done