-
Notifications
You must be signed in to change notification settings - Fork 5
/
mx-fb-tour
executable file
·195 lines (164 loc) · 4.99 KB
/
mx-fb-tour
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
#!/bin/bash
#
# Fluxbox specific MX Tour for MX Linux 21
#
# set some stuff up
KEY=$(( ($$ * $RANDOM) % 2**15))
# set to run dir if images and text exists
[[ ${0%%/*} == . ]] && [[ -d text ]] && TXTDIR=./text
[[ ${0%%/*} == . ]] && [[ -d images ]] && IMGDIR=./images
: ${TXTDIR:=/usr/share/mx-tour/text}
: ${IMGDIR:=/usr/share/mx-tour/images}
WINDOW_ICON=/usr/share/icons/hicolor/scalable/apps/mx-tour.svg
WINDOW_CLASS=mx-tour
WINDOW_WIDTH=950
WINDOW_HEIGHT=695
# l10n
export TEXTDOMAIN=mx-tour
export TEXTDOMAINDIR=/usr/share/locale
#. gettext.sh
TITLE=$(gettext "MX Tour (Fluxbox)")
INTRO=$(gettext "Intro")
PANEL=$(gettext "Panel")
APP_DOCK=$(gettext "App Dock")
CONKY=$(gettext "Conky")
MX_TOOLS=$(gettext "MX Tools")
MX_WELCOME=$(gettext "MX Welcome")
MXFB_SETTINGS=$(gettext "MXFB Settings")
MX_TWEAK=$(gettext "MX Tweak")
INSTALL_APPS=$(gettext "Install Apps")
UPDATING=$(gettext "Updating")
MX_SNAPSHOT=$(gettext "MX Snapshot")
TIMESHIFT=$(gettext "Timeshift")
SYSTEM_INFO=$(gettext "System Info")
GET_HELP=$(gettext "Get Help")
APP_FINDER=$(gettext "App Finder")
WELCOME=$(gettext "WELCOME TO THE MX LINUX TOUR")
HELPTEXT=$(gettext "Below are some available resources to get help")
CLOSE=$(gettext gtk30 "_Close")
NEXT=$(gettext gtk30 "_Next")
PREVIOUS=$(gettext gtk30 "_Previous")
# some functions
pushtext(){ # push text file into var
local file=${1} var=${2}
: ${file:=-}
IFS='' read -r -d '' ${var} < <( eval cat "${file}") || true
}
# push texfiles into bash var's , where varname corresponds to filename
for F in ${TXTDIR}/*; do
[[ -f ${F} ]] || continue # only files
N=${F##*/} # basename
N=${N//-/_} # replace hyphens with underline
[[ -z ${N##*.*} ]] && continue # ignore any backup files with dot
[[ -z ${N##*~} ]] && continue # ignore any backup files with ~
declare -n nameref=$N
pushtext "$F" $N
nameref=$(gettext "$nameref")
done
TEXT_INFO="--text-info --wrap --margins=5"
# Intro tab
# Intro tab
yad --plug=$KEY --tabnum=1 \
--image=${IMGDIR}/mxfb_tour_intro.png \
--image-on-top \
$TEXT_INFO <<<$mxfb_tour_intro &
# Tint2 Panel tab
yad --plug=$KEY --tabnum=2 \
--image=${IMGDIR}/tint2_panel.png \
--image-on-top \
$TEXT_INFO <<<$tint2_panel &
# Application Finder tab
yad --plug=$KEY --tabnum=3 \
--image=${IMGDIR}/app_finder.png \
$TEXT_INFO <<<$app_finder &
# Application Dock tab
yad --plug=$KEY --tabnum=4 \
--image=${IMGDIR}/mxfb_dock.png \
$TEXT_INFO <<<$mxfb_dock &
# Conky tab
yad --plug=$KEY --tabnum=5 \
--image=${IMGDIR}/conky.png \
--image-on-top \
$TEXT_INFO <<<$mxfb_conky &
# MX Tools tab
yad --plug=$KEY --tabnum=6 \
--image=${IMGDIR}/mx_tools.png \
--image-on-top \
$TEXT_INFO <<<$mx_tools &
# MX Welcome tab
yad --plug=$KEY --tabnum=7 \
--image=${IMGDIR}/mx_welcome.png \
--image-on-top \
$TEXT_INFO <<<$mx_welcome &
# MXFB Settings Manager tab
yad --plug=$KEY --tabnum=8 \
--image=${IMGDIR}/mxfb_settings.png \
--image-on-top \
$TEXT_INFO <<<$mxfb_settings &
# MX Tweak tab
yad --plug=$KEY --tabnum=9 \
--image=${IMGDIR}/mxfb_tweak.png \
--image-on-top \
$TEXT_INFO <<<$mxfb_tweak &
# Install Apps tab
yad --plug=$KEY --tabnum=10 \
--image=${IMGDIR}/mxpi.png \
--image-on-top \
$TEXT_INFO <<<$mxpi &
# MX Updater tab
yad --plug=$KEY --tabnum=11 \
--image=${IMGDIR}/mxfb_updater.png \
--image-on-top \
$TEXT_INFO <<<$mx_updater &
# MX Snapshot tab
yad --plug=$KEY --tabnum=12 \
--image=${IMGDIR}/mx_snapshot.png \
--image-on-top \
$TEXT_INFO <<<$mx_snapshot &
# QSI tab
yad --plug=$KEY --tabnum=13 \
--image=${IMGDIR}/qsi.png \
--image-on-top \
$TEXT_INFO <<<$qsi &
# Get Help tab
yad --plug=$KEY --tabnum=14 \
--image=help-browser \
--text="$GET_HELP" \
--text="<b>$HELPTEXT</b>" --text-align=center \
yad --icons --read-dir=/usr/share/mx-tour/desktop-files/ --single-click --monitor --icon-size=64 --item-width=96 &
# main dialog
MAIN=(
yad
--notebook
--title="$TITLE"
--window-icon="$WINDOW_ICON"
--class="$WINDOW_CLASS"
--width=$WINDOW_WIDTH
--height=$WINDOW_HEIGHT
--no-buttons
--fixed
--center
--stack
# --button="$CLOSE"
# --button="$PREVIOUS"
# --button="$NEXT"
--key=$KEY
--tab-pos=left
--tab="$INTRO"
--tab="$PANEL"
--tab="$APP_FINDER"
--tab="$APP_DOCK"
--tab="$CONKY"
--tab="$MX_TOOLS"
--tab="$MX_WELCOME"
--tab="$MXFB_SETTINGS"
--tab="$MX_TWEAK"
--tab="$INSTALL_APPS"
--tab="$UPDATING"
--tab="$MX_SNAPSHOT"
--tab="$SYSTEM_INFO"
--tab="$GET_HELP"
--active-tab=${1:-1}
)
"${MAIN[@]}"
exit 0