modified: openstmerge.py
[GalaxyCodeBases.git] / etc / tiny / winefontssmoothing_en.sh
blobf628fb1599aa5b2f1619110217387da152ac83a7
1 #!/bin/sh
2 # Quick and dirty script for configuring wine font smoothing
4 # Author: Igor Tarasov <tarasov.igor@gmail.com>
6 WINE=${WINE:-wine}
7 WINEPREFIX=${WINEPREFIX:-$HOME/.wine}
8 DIALOG=whiptail
10 if [ ! -x "`which "$WINE"`" ]
11 then
12 echo "Wine was not found. Is it really installed? ($WINE)"
13 exit 1
16 if [ ! -x "`which "$DIALOG"`" ]
17 then
18 DIALOG=dialog
21 TMPFILE=`mktemp` || exit 1
23 $DIALOG --menu \
24 "Please select font smoothing mode for wine programs:" 13 51\
26 1 "Smoothing disabled"\
27 2 "Grayscale smoothing"\
28 3 "Subpixel smoothing (ClearType) RGB"\
29 4 "Subpixel smoothing (ClearType) BGR" 2> $TMPFILE
31 STATUS=$?
32 ANSWER=`cat $TMPFILE`
34 if [ $STATUS != 0 ]
35 then
36 rm -f $TMPFILE
37 exit 1
40 MODE=0 # 0 = disabled; 2 = enabled
41 TYPE=0 # 1 = regular; 2 = subpixel
42 ORIENTATION=1 # 0 = BGR; 1 = RGB
44 case $ANSWER in
45 1) # disable
47 2) # enable
48 MODE=2
49 TYPE=1
51 3) # enable cleartype rgb
52 MODE=2
53 TYPE=2
55 4) # enable cleartype bgr
56 MODE=2
57 TYPE=2
58 ORIENTATION=0
61 rm -f $TMPFILE
62 echo Unexpected option: $ANSWER
63 exit 1
65 esac
67 echo "REGEDIT4
69 [HKEY_CURRENT_USER\Control Panel\Desktop]
70 \"FontSmoothing\"=\"$MODE\"
71 \"FontSmoothingOrientation\"=dword:0000000$ORIENTATION
72 \"FontSmoothingType\"=dword:0000000$TYPE
73 \"FontSmoothingGamma\"=dword:00000578" > $TMPFILE
75 echo -n "Updating configuration... "
77 $WINE regedit $TMPFILE 2> /dev/null
79 rm -f $TMPFILE
81 echo ok