Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
fixed wine font smoothing function
Browse files Browse the repository at this point in the history
  • Loading branch information
snwh committed Jan 12, 2019
1 parent f77c3b8 commit 72e9cb7
Showing 1 changed file with 80 additions and 68 deletions.
148 changes: 80 additions & 68 deletions functions/install_wine
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ function install_wine_package {
install_package "Wine" "wine" install_wine
}

# Install Winetricks
function install_winetricks {
install_package "Winetricks" "winetricks" install_wine
}

# Install all fonts with winetricks
function winetricks_allfonts {
# install all fonts
winetricks allfonts
}

# Create of Wine app folder
function create_wine_app_folder {
# Create empty app folder for Wine
Expand All @@ -23,87 +34,86 @@ function create_wine_app_folder {
echo_message info "Adding Wine app .desktop files to folder..."
gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/Wine/ apps "['wine-mime-msi.desktop',\
'wine-notepad.desktop',\
'wine-oleview.desktop',\
'wine-regedit.desktop',\
'wine-uninstaller.desktop',\
'wine-wineboot.desktop',\
'wine-winecfg.desktop',\
'wine-winefile.desktop',\
'wine-winhelp.desktop',\
'wine-winemine.desktop',\
'wine-oleview.desktop',\
'wine-uninstaller.desktop',\
'wine-winhelp.desktop',\
'wine-wordpad.desktop',\
'wine.desktop',\
'wine-wordpad.desktop']"
'winetricks.desktop']"
# Done.
echo_message success "Creation of Wine app folder complete."
whiptail --title "Finished" --msgbox "Creation of Wine app folder complete." 8 56
install_wine
}

# function wine_regedit {

# echo "REGEDIT4

# [HKEY_CURRENT_USER\Control Panel\Desktop]
# \"FontSmoothing\"=\"$MODE\"
# \"FontSmoothingOrientation\"=dword:0000000$ORIENTATION
# \"FontSmoothingType\"=dword:0000000$TYPE
# \"FontSmoothingGamma\"=dword:00000578" > $TMPFILE

# echo -n "Updating configuration... "

# $Wine regedit $TMPFILE 2> /dev/null
# }
# regedit font smoothin
function wine_regedit {
TMPFILE=/tmp/wine_font_smoothing.reg
echo "REGEDIT4
[HKEY_CURRENT_USER\Control Panel\Desktop]
\"FontSmoothing\"=\"$MODE\"
\"FontSmoothingOrientation\"=dword:0000000$ORIENTATION
\"FontSmoothingType\"=dword:0000000$TYPE
\"FontSmoothingGamma\"=dword:00000578" > $TMPFILE
# write reg file to wine
wine regedit $TMPFILE 2> /dev/null
}

# function wine_font_smoothing {
# status="0"
# while [ "$status" -eq 0 ]; do
# VERSION=$(eval `resize` && whiptail \
# --title "Wine Font Smoothing" \
# --menu "Select font smoothing mode for wine apps." \
# $LINES $COLUMNS $(( $LINES - 12 )) \
# "disabled" "Smoothing disabled"\
# "greyscale" "Grayscale smoothing"\
# "subpixel_rgb" "Subpixel smoothing (ClearType) RGB"\
# "subpixel_bgr" "Subpixel smoothing (ClearType) BGR" \
# 3>&1 1>&2 2>&3)
# # Change to lower case and remove spaces.
# case "${VERSION}" in
# disabled)
# # disable
# MODE=0 # 0 = disabled; 2 = enabled
# TYPE=0 # 1 = regular; 2 = subpixel
# ORIENTATION=1 # 0 = BGR; 1 = RGB
# wine_regedit $MODE $TYPE $ORIENTATION wine_font_smoothing
# ;;
# greyscale)
# # enable greyscale smoothing
# MODE=2
# TYPE=1
# wine_regedit $MODE $TYPE $ORIENTATION wine_font_smoothing
# ;;
# ;;
# subpixel_rgb)
# # enable greyscale smoothing
# MODE=2
# TYPE=2
# wine_regedit $MODE $TYPE $ORIENTATION wine_font_smoothing
# ;;
# ;;
# subpixel_bgr)
# # enable greyscale smoothing
# MODE=2
# TYPE=2
# ORIENTATION=0
# wine_regedit $MODE $TYPE $ORIENTATION wine_font_smoothing
# ;;
# ;;
# # return
# *) status=1
# install_wine
# ;;
# esac
# done
# }
# wine font smoothing
function wine_font_smoothing {
status="0"
while [ "$status" -eq 0 ]; do
VERSION=$(eval `resize` && whiptail \
--notags \
--title "Wine Font Smoothing" \
--cancel-button "Go Back" \
--menu "Select font smoothing mode for wine apps." \
$LINES $COLUMNS $(( $LINES - 12 )) \
"disabled" "Smoothing disabled"\
"greyscale" "Grayscale smoothing"\
"subpixel_rgb" "Subpixel smoothing (ClearType) RGB"\
"subpixel_bgr" "Subpixel smoothing (ClearType) BGR" \
3>&1 1>&2 2>&3)
# Change to lower case and remove spaces.
case "${VERSION}" in
disabled)
# disable
MODE=0 # 0 = disabled; 2 = enabled
TYPE=0 # 1 = regular; 2 = subpixel
ORIENTATION=1 # 0 = BGR; 1 = RGB
wine_regedit $MODE $TYPE $ORIENTATION wine_font_smoothing
;;
greyscale)
# enable greyscale smoothing
MODE=2
TYPE=1
wine_regedit $MODE $TYPE $ORIENTATION wine_font_smoothing
;;
subpixel_rgb)
# enable greyscale smoothing
MODE=2
TYPE=2
wine_regedit $MODE $TYPE $ORIENTATION wine_font_smoothing
;;
subpixel_bgr)
# enable greyscale smoothing
MODE=2
TYPE=2
ORIENTATION=0
wine_regedit $MODE $TYPE $ORIENTATION wine_font_smoothing
;;
# return
*) status=1
install_wine
;;
esac
done
}

# Install Wine
function install_wine {
Expand All @@ -118,7 +128,9 @@ function install_wine {
--cancel-button "Go Back" \
$LINES $COLUMNS $(( $LINES - 12 )) \
'install_wine_package' 'Install Wine' \
'install_winetricks' 'Install Winetricks' \
'create_wine_app_folder' 'Create app folder for Wine apps' \
'wine_font_smoothing' 'Set up font smoothing in Wine' \
3>&1 1>&2 2>&3)
# check exit status
if [ $? = 0 ]; then
Expand Down

0 comments on commit 72e9cb7

Please sign in to comment.