summaryrefslogtreecommitdiffstats
path: root/src/updates/gwenview_1.4_osdformat.sh
blob: 6a28550302380b1b67233aabb69df4e2a77d9f67 (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
#!/bin/sh

# Escape backslashes. Shell sucks.
sed s'/\\/BACKSLASH/g' | ( 

osdMode=
while read line ; do
	if echo $line | grep '^osd mode' >/dev/null 2>/dev/null ; then
		osdMode=$(echo $line | sed 's/^.*=//')
		continue
	fi
	if echo $line | grep '^free output format' >/dev/null 2>/dev/null ; then
		freeOutputFormat=$(echo $line | sed -e 's/^.*=//')
		continue
	fi
	echo $line
done

case $osdMode in
	0)
		osdFormat=''
		;;
	1)
		osdFormat='%p'
		;;
	2)
		osdFormat='%c'
		;;
	3)
		osdFormat='%p\\n%c'
		;;
	4)
		osdFormat="$freeOutputFormat"
		;;
	*)
		osdFormat=''
		;;
esac

echo osdFormat=$osdFormat

) | sed 's/BACKSLASH/\\/g'
# Escape backslashes. Shell sucks.