summaryrefslogtreecommitdiff
path: root/coolbg
blob: 1261ce7593e55870166c52967b4e92c179b5e9c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/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=`uname -m`
if [ $ARCH == "i686" ]; then
SAVERPATH=/usr/lib/xscreensaver
elif [ $ARCH == "x86_64" ]; then
SAVERPATH=/usr/lib64/xscreensaver
fi
need_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 $1
if [ x"$RUNPARAM" = x"-x" ]; then
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
fi
if [ x"$RUNPARAM" = x"-m" ]; then
while true; do
ls
echo "Select the movie to play on the background:"
read background
bg=$background
xwinwrap -ni -fs -s -st -sp -b -nf -- mplayer -wid WID -quiet $bg
done
fi