This repository was archived by the owner on Oct 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathinstall_wine
More file actions
144 lines (137 loc) · 4.12 KB
/
Copy pathinstall_wine
File metadata and controls
144 lines (137 loc) · 4.12 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
# Install Wine
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
if ! [[ $(gsettings get org.gnome.desktop.app-folders folder-children | grep "Wine") ]]; then
echo_message info "Adding Wine app folder..."
# Get list of app folders from gsettings and add Wine
APPFOLDERS=$(sed s/"']"/"', 'Wine']"/g <<< $(gsettings get org.gnome.desktop.app-folders folder-children))
gsettings set org.gnome.desktop.app-folders folder-children "$APPFOLDERS"
else
echo_message info "Wine app folder already exists."
fi
# Set app folder name
echo_message info "Setting Wine app folder name..."
gsettings set org.gnome.desktop.app-folders.folder:/org/gnome/desktop/app-folders/folders/Wine/ name 'Wine'
# Add wine app desktop files to 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-winemine.desktop',\
'wine-winhelp.desktop',\
'wine-wordpad.desktop',\
'wine.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
}
# 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
}
# 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 {
NAME="Wine"
echo_message title "Starting $NAME installation..."
# Draw window
GAMES=$(eval `resize` && whiptail \
--notags \
--title "Install $NAME" \
--menu "\nWhat would you like to do?" \
--ok-button "Install" \
--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
echo_message header "Starting '$GAMES' function"
$GAMES
else
# Cancelled
echo_message info "$NAME installation cancelled."
main
fi
}