All pastes #767334 Raw Edit

Miscellany

public shellscript v1 · immutable
·published 2007-11-09 17:55 UTC
rendered paste body
#!/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###SAVERPATH=/usr/lib/xscreensaverneed_help() {	## See if any parameters was supplied. If not, or to many, show help	if [ x"$1" = x"" -o x"$2" != x"" ]; then		echo ""		echo "Please run coolbg again with one of the following parameters;"		echo "You have to provide the full path where the movie file is"		echo "   -x    - Use xscreensaver as a cool background"		echo "   -m    - Play movie as a background, cd to folder containing movie files(requires mplayer)"		exit 1	fi	RUNPARAM=$1}need_help $1if [ x"$RUNPARAM" = x"-x" ]; thenwhile true; dols $SAVERPATHecho "Select your cool background:"read backgroundbg=$backgroundecho -n "Want to run in foreground? (y/n) "read yncase $yn iny* | 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" ;;esacdonefiif [ x"$RUNPARAM" = x"-m" ]; thenwhile true; dolsecho "Select the movie to play on the background:"read backgroundbg=$backgroundxwinwrap -ni -fs -s -st -sp -b -nf -- mplayer -wid WID -quiet $bgdonefi