SlideShare a Scribd company logo
1 of 2
#!/bin/sh
# Quick and dirty script for configuring wine font smoothing
#
# Author: Igor Tarasov <tarasov.igor@gmail.com>
WINE=${WINE:-wine}
WINEPREFIX=${WINEPREFIX:-$HOME/.wine}
DIALOG=whiptail
if [ ! -x "`which "$WINE"`" ]
then
echo "Wine was not found. Is it really installed? ($WINE)"
exit 1
fi
if [ ! -x "`which "$DIALOG"`" ]
then
DIALOG=dialog
fi
TMPFILE=`mktemp` || exit 1
$DIALOG --menu 
"Please select font smoothing mode for wine programs:" 13 51
4
1 "Smoothing disabled"
2 "Grayscale smoothing"
3 "Subpixel smoothing (ClearType) RGB"
4 "Subpixel smoothing (ClearType) BGR" 2> $TMPFILE
STATUS=$?
ANSWER=`cat $TMPFILE`
if [ $STATUS != 0 ]
then
rm -f $TMPFILE
exit 1
fi
MODE=0 # 0 = disabled; 2 = enabled
TYPE=0 # 1 = regular; 2 = subpixel
ORIENTATION=1 # 0 = BGR; 1 = RGB
case $ANSWER in
1) # disable
;;
2) # enable
MODE=2
TYPE=1
;;
3) # enable cleartype rgb
MODE=2
TYPE=2
;;
4) # enable cleartype bgr
MODE=2
TYPE=2
ORIENTATION=0
;;
*)
rm -f $TMPFILE
echo Unexpected option: $ANSWER
exit 1
;;
esac
echo "REGEDIT4
[HKEY_CURRENT_USERControl PanelDesktop]
"FontSmoothing"="$MODE"
"FontSmoothingOrientation"=dword:0000000$ORIENTATION
"FontSmoothingType"=dword:0000000$TYPE
"FontSmoothingGamma"=dword:00000578" > $TMPFILE
echo -n "Updating configuration... "
$WINE regedit $TMPFILE 2> /dev/null
rm -f $TMPFILE
echo ok

More Related Content

What's hot

Flutter 勉強会20190220
Flutter 勉強会20190220Flutter 勉強会20190220
Flutter 勉強会20190220HiroakiTakesue
 
Value & Emotion: Create vs curate - Alone vsTogether
Value & Emotion: Create vs curate - Alone vsTogetherValue & Emotion: Create vs curate - Alone vsTogether
Value & Emotion: Create vs curate - Alone vsTogetherNick Kellet
 
How do I run multiple python apps in 1 command line under 1 WSGI app?
How do I run multiple python apps in 1 command line under 1 WSGI app?How do I run multiple python apps in 1 command line under 1 WSGI app?
How do I run multiple python apps in 1 command line under 1 WSGI app?Susan Tan
 

What's hot (6)

Flutter 勉強会20190220
Flutter 勉強会20190220Flutter 勉強会20190220
Flutter 勉強会20190220
 
Value & Emotion: Create vs curate - Alone vsTogether
Value & Emotion: Create vs curate - Alone vsTogetherValue & Emotion: Create vs curate - Alone vsTogether
Value & Emotion: Create vs curate - Alone vsTogether
 
087 alaala
087 alaala087 alaala
087 alaala
 
067 almulk
067 almulk067 almulk
067 almulk
 
061 assaff
061 assaff061 assaff
061 assaff
 
How do I run multiple python apps in 1 command line under 1 WSGI app?
How do I run multiple python apps in 1 command line under 1 WSGI app?How do I run multiple python apps in 1 command line under 1 WSGI app?
How do I run multiple python apps in 1 command line under 1 WSGI app?
 

Viewers also liked

Fraternidad Del Tamal 2
Fraternidad Del Tamal 2Fraternidad Del Tamal 2
Fraternidad Del Tamal 2nicorleone
 
Business Analysis Advanced Training plan - VARNAAZ
Business Analysis Advanced Training plan - VARNAAZBusiness Analysis Advanced Training plan - VARNAAZ
Business Analysis Advanced Training plan - VARNAAZbusinessanalysistraining
 
Evolution of cooking
Evolution of cookingEvolution of cooking
Evolution of cookingBOROSIL
 

Viewers also liked (6)

Domus 2013.04 1
Domus 2013.04 1Domus 2013.04 1
Domus 2013.04 1
 
Proyecto final unificacion
Proyecto final unificacionProyecto final unificacion
Proyecto final unificacion
 
Fraternidad Del Tamal 2
Fraternidad Del Tamal 2Fraternidad Del Tamal 2
Fraternidad Del Tamal 2
 
Preza 1234
Preza 1234Preza 1234
Preza 1234
 
Business Analysis Advanced Training plan - VARNAAZ
Business Analysis Advanced Training plan - VARNAAZBusiness Analysis Advanced Training plan - VARNAAZ
Business Analysis Advanced Training plan - VARNAAZ
 
Evolution of cooking
Evolution of cookingEvolution of cooking
Evolution of cooking
 

Similar to Winefontssmoothing en

What is systemd? Why use it? how does it work? - breizhcamp
What is systemd? Why use it? how does it work? - breizhcampWhat is systemd? Why use it? how does it work? - breizhcamp
What is systemd? Why use it? how does it work? - breizhcampQuentin Adam
 
Backup script
Backup scriptBackup script
Backup scriptMohsen B
 
What is systemd? Why use it? how does it work? - devoxx france 2017
What is systemd? Why use it? how does it work? - devoxx france 2017What is systemd? Why use it? how does it work? - devoxx france 2017
What is systemd? Why use it? how does it work? - devoxx france 2017Quentin Adam
 
Apache Hadoop Shell Rewrite
Apache Hadoop Shell RewriteApache Hadoop Shell Rewrite
Apache Hadoop Shell RewriteAllen Wittenauer
 

Similar to Winefontssmoothing en (6)

Regsetup
RegsetupRegsetup
Regsetup
 
What is systemd? Why use it? how does it work? - breizhcamp
What is systemd? Why use it? how does it work? - breizhcampWhat is systemd? Why use it? how does it work? - breizhcamp
What is systemd? Why use it? how does it work? - breizhcamp
 
Backup script
Backup scriptBackup script
Backup script
 
What is systemd? Why use it? how does it work? - devoxx france 2017
What is systemd? Why use it? how does it work? - devoxx france 2017What is systemd? Why use it? how does it work? - devoxx france 2017
What is systemd? Why use it? how does it work? - devoxx france 2017
 
Apache Hadoop Shell Rewrite
Apache Hadoop Shell RewriteApache Hadoop Shell Rewrite
Apache Hadoop Shell Rewrite
 
D Is For Driven
D Is For DrivenD Is For Driven
D Is For Driven
 

Winefontssmoothing en

  • 1. #!/bin/sh # Quick and dirty script for configuring wine font smoothing # # Author: Igor Tarasov <tarasov.igor@gmail.com> WINE=${WINE:-wine} WINEPREFIX=${WINEPREFIX:-$HOME/.wine} DIALOG=whiptail if [ ! -x "`which "$WINE"`" ] then echo "Wine was not found. Is it really installed? ($WINE)" exit 1 fi if [ ! -x "`which "$DIALOG"`" ] then DIALOG=dialog fi TMPFILE=`mktemp` || exit 1 $DIALOG --menu "Please select font smoothing mode for wine programs:" 13 51 4 1 "Smoothing disabled" 2 "Grayscale smoothing" 3 "Subpixel smoothing (ClearType) RGB" 4 "Subpixel smoothing (ClearType) BGR" 2> $TMPFILE STATUS=$? ANSWER=`cat $TMPFILE` if [ $STATUS != 0 ] then rm -f $TMPFILE exit 1 fi MODE=0 # 0 = disabled; 2 = enabled TYPE=0 # 1 = regular; 2 = subpixel ORIENTATION=1 # 0 = BGR; 1 = RGB case $ANSWER in 1) # disable ;; 2) # enable MODE=2 TYPE=1 ;; 3) # enable cleartype rgb MODE=2 TYPE=2 ;; 4) # enable cleartype bgr MODE=2 TYPE=2 ORIENTATION=0 ;; *) rm -f $TMPFILE echo Unexpected option: $ANSWER exit 1 ;;