Browse code

Added a new tool - "Update dragdropped Minimal Ramize-Physave folder".

Uses code from APSK ext2 Disk Image Mounter.

https://apollia.org/gitlist/APSK---ext2-Disk-Image-Mounter.git

Apollia authored on09/12/2018 13:39:23
Showing16 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,11 @@
1
+#!/bin/bash
2
+
3
+readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}")
4
+	readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script")
5
+
6
+cd "$Follpath____This_Script"
7
+
8
+rox
9
+
10
+bash "Updater for Minimal Ramize-Physave" "$@" &
11
+
0 12
new file mode 100755
... ...
@@ -0,0 +1,2 @@
1
+#!/bin/bash
2
+
0 3
new file mode 100755
... ...
@@ -0,0 +1,357 @@
1
+#!/bin/bash
2
+
3
+# 19:59:49 03/31/2018.  A lot of these functions were originally released
4
+# in:
5
+#
6
+#	https://github.com/Apollia/VUE-Related-Bash-Scripts
7
+#
8
+#
9
+# 20:01:41 03/31/2018.  I slightly modified at least some of them, and
10
+# added some new ones.
11
+
12
+
13
+############
14
+# Function
15
+Console_and_Dialog_Box____Error_Message()
16
+{
17
+	local -r error_message="$2"
18
+	local error_title="$1"
19
+	local -r width="$3"
20
+	local -r height="$4"
21
+	
22
+	
23
+	##############################
24
+	
25
+	Console____Error_Message "$error_message"
26
+	
27
+	Wrap_Text "$error_message" 80
28
+	
29
+	Dialog_Box____Error_Message "$error_title" "$retval" "$width" "$height"
30
+		
31
+
32
+	#!!!!
33
+	return 0
34
+}
35
+readonly -f Console_and_Dialog_Box____Error_Message
36
+
37
+# End of
38
+# Function
39
+############
40
+
41
+
42
+
43
+############
44
+# Function
45
+Dialog_Textbox____Display_File()
46
+{
47
+	local -r fillepath="$2"
48
+	local -r title="$1"
49
+	local -r width="$3"
50
+	local -r height="$4"
51
+	
52
+	#----
53
+	local file_contents
54
+	
55
+	##############################
56
+	
57
+
58
+	
59
+	file_contents=$(cat "$fillepath")
60
+	
61
+	Dialog_Textbox____Message "$title" "$file_contents" "$width" "$height"
62
+			
63
+
64
+	#!!!!
65
+	return 0
66
+}
67
+readonly -f Dialog_Textbox____Display_File
68
+
69
+# End of
70
+# Function
71
+############
72
+
73
+
74
+
75
+############
76
+# Function
77
+Console_and_Dialog_Textbox____Display_File()
78
+{
79
+	local -r fillepath="$2"
80
+	local -r title="$1"
81
+	local -r width="$3"
82
+	local -r height="$4"
83
+	
84
+	#----
85
+	local file_contents
86
+	
87
+	##############################
88
+	
89
+
90
+	
91
+	file_contents=$(cat "$fillepath")
92
+	
93
+	Console_and_Dialog_Textbox____Message "$title" "$file_contents" "$width" "$height"
94
+			
95
+
96
+	#!!!!
97
+	return 0
98
+}
99
+readonly -f Console_and_Dialog_Textbox____Display_File
100
+
101
+# End of
102
+# Function
103
+############
104
+
105
+
106
+
107
+############
108
+# Function
109
+Console_and_Dialog_Textbox____Message()
110
+{
111
+	local -r message="$2"
112
+	local -r title="$1"
113
+	local -r width="$3"
114
+	local -r height="$4"
115
+	
116
+	
117
+	##############################
118
+	
119
+	Console____Message "$message"
120
+
121
+	Dialog_Textbox____Message "$title" "$message" "$width" "$height"
122
+		
123
+
124
+	#!!!!
125
+	return 0
126
+}
127
+readonly -f Console_and_Dialog_Textbox____Message
128
+
129
+# End of
130
+# Function
131
+############
132
+
133
+
134
+
135
+############
136
+# Function
137
+Console_and_Dialog_Box____Message()
138
+{
139
+	local -r message="$2"
140
+	local -r title="$1"
141
+	local -r width="$3"
142
+	local -r height="$4"
143
+	
144
+	
145
+	##############################
146
+	
147
+	Console____Message "$message"
148
+	
149
+	Wrap_Text "$message" 80
150
+
151
+	Dialog_Box____Message "$title" "$retval" "$width" "$height"
152
+		
153
+
154
+	#!!!!
155
+	return 0
156
+}
157
+readonly -f Console_and_Dialog_Box____Message
158
+
159
+# End of
160
+# Function
161
+############
162
+
163
+
164
+
165
+############
166
+# Function
167
+Wrap_Text()
168
+{
169
+	local -r message="$1"
170
+	local -r columns="$2"
171
+	
172
+	#----
173
+	local wrapped_message
174
+	
175
+	
176
+	##############################
177
+	
178
+	wrapped_message=$(echo "$message" | fold --width $columns --spaces)
179
+	
180
+	retval="$wrapped_message"
181
+}
182
+readonly -f Wrap_Text
183
+
184
+# End of
185
+# Function
186
+############
187
+
188
+
189
+
190
+############
191
+# Function
192
+Console____Message()
193
+{
194
+	local -r message="$1"
195
+
196
+
197
+	##############################
198
+	
199
+	echo "$message"
200
+	
201
+	
202
+	#!!!!
203
+	return 0
204
+}
205
+readonly -f Console____Message
206
+
207
+# End of
208
+# Function
209
+############
210
+
211
+
212
+
213
+############
214
+# Function
215
+Console____Error_Message()
216
+{
217
+	local -r error_message="$1"
218
+
219
+
220
+	##############################
221
+
222
+	
223
+	#>&2 echo "$error_message"
224
+	echo "$error_message"
225
+	
226
+	
227
+	#!!!!
228
+	return 0
229
+}
230
+readonly -f Console____Error_Message
231
+
232
+# End of
233
+# Function
234
+############
235
+
236
+
237
+
238
+############
239
+# Function
240
+Dialog_Box____Error_Message()
241
+{
242
+	local -r error_message="$2"
243
+	local -r title="$1"
244
+	local width="$3"
245
+	local height="$4"
246
+	
247
+	#@@@@@
248
+	[ -z "$width" ] && width=0
249
+	[ -z "$height" ] && height=0
250
+	
251
+	if [ -z "$title" ]
252
+	then
253
+		error_title=""
254
+	fi
255
+	
256
+	
257
+	##############################
258
+	
259
+	
260
+	Dialog_Box____Message "$error_title" "$error_message" "$width" "$height"
261
+}
262
+readonly -f Dialog_Box____Error_Message
263
+
264
+# End of
265
+# Function
266
+############
267
+
268
+
269
+
270
+############
271
+# Function
272
+Dialog_Textbox____Message()
273
+{
274
+	#----
275
+	local -r message="$2"
276
+	local -r title="$1"
277
+	local width="$3"
278
+	local height="$4"
279
+	
280
+	#@@@@
281
+	[ -z "$width" ] && width=0
282
+	[ -z "$height" ] && height=0
283
+
284
+
285
+
286
+	##############################
287
+	
288
+	
289
+	# 19:57:42 03/31/2018.  Why 2 OK buttons?  Because if I remove the cancel button,
290
+	# the user can't press Esc to dismiss the window.
291
+	#
292
+	# And the --no-ok option of Xdialog doesn't seem to work with textboxes.
293
+	
294
+	echo "$message" | Xdialog --title "$title" --buttons-style text --cancel-label "$I18n____OK" --ok-label "$I18n____OK" --textbox - "$width" "$height"
295
+
296
+
297
+	case "$?" in
298
+		0)
299
+			#echo "OK"
300
+			;;
301
+			
302
+		255)
303
+			#echo "Box closed"
304
+			;;
305
+	esac
306
+	
307
+	
308
+	#!!!!
309
+	return 0
310
+}
311
+readonly -f Dialog_Textbox____Message
312
+
313
+# End of
314
+# Function
315
+############
316
+
317
+
318
+
319
+############
320
+# Function
321
+Dialog_Box____Message()
322
+{
323
+	#----
324
+	local -r message="$2"
325
+	local -r title="$1"
326
+	local width="$3"
327
+	local height="$4"
328
+	
329
+	#@@@@
330
+	[ -z "$width" ] && width=0
331
+	[ -z "$height" ] && height=0
332
+
333
+
334
+	##############################
335
+	
336
+	
337
+	Xdialog --title "$title" --msgbox "$message" "$height" "$width" &
338
+
339
+	case "$?" in
340
+		0)
341
+			#echo "OK"
342
+			;;
343
+			
344
+		255)
345
+			#echo "Box closed"
346
+			;;
347
+	esac
348
+	
349
+	
350
+	#!!!!
351
+	return 0
352
+}
353
+readonly -f Dialog_Box____Message
354
+
355
+# End of
356
+# Function
357
+############
0 358
\ No newline at end of file
1 359
new file mode 100755
... ...
@@ -0,0 +1,30 @@
1
+#!/bin/bash
2
+
3
+
4
+Prepare_Translations()
5
+{
6
+
7
+# 07:43:34 03/10/2018.  To change the language this script displays
8
+# output in, run this command before running mkdirperms:
9
+#
10
+# 	export Language="Dog Language"
11
+#
12
+# 04:57:59 03/10/2018.  I don't understand any language other than English
13
+# well enough to write a real translation, so the only other "language"
14
+# available for now is Dog Language. :-)
15
+#
16
+#
17
+# 01:13:14 03/30/2018.  No Dog Language in this app (yet?).
18
+#
19
+# See mkdirperms for an example of a complete Dog Language translation. :-)
20
+#
21
+# https://github.com/Apollia/mkdirperms
22
+
23
+	Figure_Out_Translation_To_Use
24
+
25
+	Declare_Paths____Translation_Related
26
+
27
+
28
+	Get_Translations_for____Console
29
+
30
+}
0 31
\ No newline at end of file
1 32
new file mode 100755
... ...
@@ -0,0 +1,103 @@
1
+#!/bin/bash
2
+
3
+
4
+
5
+############
6
+# Function
7
+Parse_Script_Options()
8
+{
9
+	
10
+#-------------------------------------------------------------------------------
11
+#
12
+# Slightly modified getopt code from:
13
+#
14
+#http://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash/29754866#29754866
15
+#
16
+# Thanks to the authors, especially for the tip about using eval to properly handle quoting!
17
+
18
+	count_of_args_before_parsing_options="$#"
19
+	
20
+	#echo "count_of_args_before_parsing_options: $count_of_args_before_parsing_options"
21
+	
22
+	PARSED_OPTIONS=$(getopt --alternative --options h, --longoptions help, --name "$Short_Command_Name" -- "$@" )
23
+
24
+	if [ $? != 0 ]
25
+	then
26
+		# then getopt has complained about wrong arguments to stdout
27
+		echo
28
+		Console_Help_Message
29
+		
30
+		
31
+		#!!!!
32
+		exit 3
33
+	fi
34
+
35
+
36
+	eval set -- "$PARSED_OPTIONS"
37
+	# Use eval with "$PARSED_OPTIONS" to properly handle the quoting.
38
+
39
+	Arg____Filepath=""
40
+	Arg____Filesize=""
41
+
42
+
43
+	for arg
44
+	do
45
+		#echo "Arg: $arg"
46
+		case "$arg" in
47
+				
48
+			-h|--help)
49
+				Console_Help_Message
50
+				
51
+				
52
+				#!!!!
53
+				exit 0
54
+				;;
55
+				
56
+			--)
57
+			#	echo "Dashes!"
58
+				shift
59
+				;;
60
+		esac
61
+	done
62
+
63
+	Positional_Args=( "$@" )
64
+	count_of_positional_args="$#"
65
+	
66
+	count_of_args_after_parsing_options="$#"
67
+	
68
+	#echo "count_of_args_after_parsing_options: $count_of_args_after_parsing_options"
69
+	#echo "count_of_positional_args: $count_of_positional_args"
70
+	
71
+}
72
+readonly -f Parse_Script_Options
73
+
74
+# End of
75
+# Function
76
+############
77
+
78
+
79
+
80
+############
81
+# Function
82
+Parse_Script_Positional_Args()
83
+{
84
+	# 08:07:24 04/18/2017.  Now, the positional args (if there are any):
85
+
86
+	ARG1=${@:$OPTIND:1}
87
+	ARG2=${@:$OPTIND+1:1}
88
+	ARG3=${@:$OPTIND+2:1}
89
+
90
+	# 11:30 07/24/2016.  The below are basically abbreviated if/then statements.
91
+	#
92
+	# If ARG1 is not empty, then Arg____File gets set to $ARG1.  Etc.
93
+
94
+	#~ [ ! -z "$ARG1" ] && Arg____Disk_Image_Filepath="$ARG1"
95
+	#~ [ ! -z "$ARG2" ] && Arg____Mountpoint_Foldername="$ARG2"
96
+	#~ [ ! -z "$ARG3" ] && Arg____Slot_Number="$ARG3"
97
+
98
+}
99
+readonly -f Parse_Script_Positional_Args
100
+
101
+# End of
102
+# Function
103
+############
0 104
\ No newline at end of file
1 105
new file mode 100755
... ...
@@ -0,0 +1,276 @@
1
+#!/bin/bash
2
+
3
+
4
+function Respond_to_Dragdrop
5
+{
6
+	# 15:57:37 04/04/2018.  From:
7
+	# http://murga-linux.com/puppy/viewtopic.php?p=965523&sid=2086d0e90333e87d5266d4ec00ee25eb#965523
8
+	
9
+	Xdialog -left -backtitle "You dropped:" -msg "${DROP_ZONE// \//\n/}" x &
10
+}
11
+
12
+Update_if_this_is_a_Minimal_Ramize_Physave_folder()
13
+{
14
+	local fiol="$1"
15
+	
16
+	local not_a_min_ramphys=false
17
+		
18
+		if [ -z "$fiol" ]
19
+		then
20
+			#echo "Empty one"
21
+			return 1
22
+		fi
23
+		
24
+		if [ ! -d "$fiol" ]
25
+		then
26
+			Console_and_Dialog_Box____Error_Message "$I18n____Error" "Not a folder:
27
+
28
+	$fiol"
29
+			
30
+			return 2
31
+		fi
32
+
33
+		#Respond_to_Dragdrop
34
+		
35
+		follpath____physave="$fiol/Physave"
36
+		follpath____ramize="$fiol/Ramize"
37
+		follpath____config="$fiol/0000-Config"
38
+		
39
+		[ ! -d "$follpath____physave" ] && not_a_min_ramphys=true
40
+		[ ! -d "$follpath____ramize" ] && not_a_min_ramphys=true
41
+		[ ! -d "$follpath____config" ] && not_a_min_ramphys=true
42
+		
43
+		
44
+		if [ "$not_a_min_ramphys" = true ]
45
+		then
46
+			Console_and_Dialog_Box____Error_Message "$I18n____Error" "Did nothing, since this doesn't appear to be a Minimal Ramize-Physave folder:
47
+
48
+	$fiol"
49
+			return 3
50
+		fi
51
+		
52
+		result=$(rsync --archive --verbose --update --recursive --itemize-changes "$Follpath____Official_Minimal_Ramize_Physave/" "$fiol")
53
+		
54
+		
55
+		result_code="$?"
56
+		
57
+		echo "result_code: $result_code"
58
+		
59
+		if [ "$result_code" != 0 ]
60
+		then
61
+			Console_and_Dialog_Box____Error_Message "$I18n____Error" "$result"
62
+			
63
+			continue
64
+		fi
65
+		
66
+		Console_and_Dialog_Textbox____Message "$I18n____Succeeded" "Successfully updated Minimal Ramize folder:
67
+		
68
+$fiol
69
+
70
+
71
+Here's what rsync did:
72
+
73
+$result" 200 200
74
+		
75
+	
76
+}
77
+
78
+  
79
+function Process_dropped_items_and_update_any_detected_Minimal_Ramize_Physave_folders()
80
+{
81
+
82
+		
83
+	local stringlist
84
+
85
+
86
+	stringlist=$(echo -e "${DROP_ZONE// \//\n/}")
87
+	Convert_Newline_Separated_String_to_Array "$stringlist"
88
+	
89
+	readonly list_of_fiols=( "${retval[@]}" )
90
+	readonly count_of_fiols="$retcount"
91
+	
92
+	
93
+	for fiol in "${list_of_fiols[@]}"
94
+	do
95
+	
96
+		Update_if_this_is_a_Minimal_Ramize_Physave_folder "$fiol"
97
+	done
98
+}
99
+
100
+
101
+
102
+
103
+############
104
+# Function
105
+Convert_Newline_Separated_String_to_Array()
106
+{
107
+	string="$1"
108
+
109
+	# 2016-03-15 04:45:41.  addlater.  should trim final newline before processing.
110
+	
111
+#	echo "Orig string: \"$string\""
112
+	string="${string%$'\n'}"
113
+
114
+	#string="${string%\$'\\n'}"
115
+
116
+#	echo "Trimmed string: \"$string\""	
117
+	
118
+	
119
+	retcount=0
120
+	retval=()
121
+	
122
+	local array=()
123
+	
124
+	if [ -z "$string" ]
125
+	then
126
+		retcount=0
127
+		return 0
128
+	fi
129
+	
130
+	while read -r line; do
131
+		#echo "Line: '$line' "
132
+		array+=("$line")
133
+	done <<< "$string"
134
+	
135
+	retval=( "${array[@]}" )
136
+	# 2016-01-29 04:58:07.  Yep, it's that tough in Bash just to set a variable equal to an array.
137
+	
138
+	
139
+	retcount=${#retval[@]}		
140
+#	arraystring=$(printf '%s\n' "${array[@]}")
141
+#	echo "array: $array"
142
+#	echo "arraystring: $arraystring"
143
+}
144
+readonly -f Convert_Newline_Separated_String_to_Array
145
+
146
+# End of
147
+# Function
148
+############
149
+
150
+
151
+
152
+Build_GUI_Window()
153
+{
154
+	local -r should_mount_writably="$1"
155
+	
156
+	
157
+	
158
+	Gtkdialog_Snippet____Ctrl_Q_to_Quit='
159
+<action signal="key-press-event" condition="command_is_true([[ $(( $KEY_MOD & 4 )) = 4 && $KEY_SYM = [qQ] ]] && echo true )">EXIT:quit</action>'
160
+
161
+	Gtkdialog_Snippet____Esc_to_Quit='
162
+<action signal="key-press-event" condition="command_is_true([ $KEY_VAL = 0xff1b ] && echo true )">EXIT:quit</action>'
163
+
164
+
165
+	GUI_BEING_BUILT="<window title=\"$GUI_Window_Title\""
166
+	GUI_BEING_BUILT+='
167
+icon-name="Drop-48x48">'
168
+	
169
+	# 15:57:37 04/04/2018.  Slightly modified drag/drop entry and frame code from:
170
+# http://murga-linux.com/puppy/viewtopic.php?p=965523&sid=2086d0e90333e87d5266d4ec00ee25eb#965523
171
+
172
+	GUI_BEING_BUILT+="
173
+<frame $GUI_Window_Text>"
174
+
175
+	GUI_BEING_BUILT+='
176
+<entry can-focus="false" has-frame="false">
177
+   <variable>DROP_ZONE</variable>
178
+   <width>400</width>
179
+   <height>400</height>
180
+   
181
+   <action>[[ $DROP_ZONE ]] && Process_dropped_items_and_update_any_detected_Minimal_Ramize_Physave_folders'
182
+   
183
+   if [ "$should_mount_writably" = "should mount writably" ]
184
+   then
185
+		GUI_BEING_BUILT+=' "mount writably"'
186
+	fi
187
+	
188
+	GUI_BEING_BUILT+='</action>'
189
+   GUI_BEING_BUILT+='
190
+   <action>clear:DROP_ZONE</action>
191
+</entry>'
192
+
193
+	GUI_BEING_BUILT+='
194
+	
195
+</frame>'
196
+
197
+	GUI_BEING_BUILT+="$Gtkdialog_Snippet____Ctrl_Q_to_Quit
198
+$Gtkdialog_Snippet____Esc_to_Quit"
199
+
200
+	GUI_BEING_BUILT+='</window>'
201
+	
202
+	echo "$GUI_BEING_BUILT"
203
+	
204
+	retval="$GUI_BEING_BUILT"
205
+}
206
+
207
+
208
+
209
+############
210
+# Function
211
+Open_Folder_With_Rox()
212
+{
213
+	local filepath="$1"
214
+	
215
+	#----
216
+	local folpath_to_open
217
+	
218
+	
219
+	##############################	
220
+	
221
+		
222
+	folpath_to_open="$filepath"
223
+	
224
+	rox "$folpath_to_open"
225
+
226
+}
227
+readonly -f Open_Folder_With_Rox
228
+
229
+# End of
230
+# Function
231
+############
232
+
233
+
234
+
235
+Prepare_GUI()
236
+{
237
+	local -r should_mount_writably="$1"
238
+	
239
+	
240
+
241
+	
242
+	
243
+	GUI_Window_Title="$I18n____Updater_for_Minimal_Ramize_Physave"
244
+	
245
+	GUI_Window_Text="$I18n____Dragdrop_Minimal_Ramize_Physave_folders_into_this_box_to_update_them"
246
+
247
+	GUI_Window_Text+=":"
248
+	Build_GUI_Window
249
+
250
+
251
+	GUI_WINDOW="$retval"
252
+
253
+	declare -a List_of_Dropped_Files
254
+
255
+	export Follpath____Official_Minimal_Ramize_Physave
256
+	export List_of_Dropped_Files
257
+	export GUI_WINDOW
258
+	export -f Convert_Newline_Separated_String_to_Array
259
+	export -f Update_if_this_is_a_Minimal_Ramize_Physave_folder
260
+	export -f Respond_to_Dragdrop
261
+	export -f Open_Folder_With_Rox
262
+	export -f Wrap_Text
263
+	export -f Console_and_Dialog_Box____Error_Message
264
+	export -f Console_and_Dialog_Box____Message
265
+	export -f Console____Error_Message
266
+	export -f Dialog_Box____Error_Message
267
+	export -f Dialog_Box____Message
268
+	export -f Console_and_Dialog_Textbox____Message
269
+	export -f Console____Message
270
+	export -f Dialog_Textbox____Message
271
+	export -f Process_dropped_items_and_update_any_detected_Minimal_Ramize_Physave_folders
272
+	export I18n____Error
273
+	export I18n____Succeeded
274
+	
275
+	gtkdialog --center --program=GUI_WINDOW
276
+}
0 277
\ No newline at end of file
1 278
new file mode 100755
... ...
@@ -0,0 +1,86 @@
1
+#!/bin/bash
2
+
3
+
4
+
5
+
6
+
7
+############
8
+# Function
9
+Figure_Out_Translation_To_Use()
10
+{
11
+	# 07:43:34 03/10/2018.  To change the language this script displays
12
+	# output in, run this command before running mkdirperms:
13
+	#
14
+	# 	export Language="Dog Language"
15
+	#
16
+	# 04:57:59 03/10/2018.  I don't understand any language other than English
17
+	# well enough to write a real translation, so the only other "language"
18
+	# available for now is Dog Language. :-)
19
+	#
20
+	#
21
+	# 01:13:14 03/30/2018.  No Dog Language in this app (yet?).
22
+	#
23
+	# See mkdirperms for an example of a complete Dog Language translation. :-)
24
+	#
25
+	# https://github.com/Apollia/mkdirperms
26
+	
27
+	
28
+	case "$Language" in
29
+		"Dog Language")
30
+			Translation_Lang="Dog Language"
31
+			;;
32
+		*)
33
+			Translation_Lang="English - US"
34
+			;;
35
+	esac
36
+}
37
+readonly -f Figure_Out_Translation_To_Use
38
+
39
+# End of
40
+# Function
41
+############
42
+
43
+
44
+
45
+############
46
+# Function
47
+Declare_Paths____Translation_Related()
48
+{
49
+	readonly Follpath____All_Translations="$Follpath____This_Script/Translations"
50
+
51
+		readonly Follpath____Translations="$Follpath____All_Translations/$Translation_Lang"
52
+
53
+			readonly Fillepath____Translation_Phrases="$Follpath____Translations/00-Phrases"
54
+	
55
+}
56
+readonly -f Declare_Paths____Translation_Related
57
+
58
+# End of
59
+# Function
60
+############
61
+
62
+
63
+
64
+
65
+#----------10:56:17 03/10/2018.  Boring clutter:
66
+
67
+
68
+############
69
+# Function
70
+Get_Translations_for____GUI()
71
+{
72
+	Get_Translation "Dragdrop Minimal Ramize-Physave folders into this box to update them"
73
+		I18n____Dragdrop_Minimal_Ramize_Physave_folders_into_this_box_to_update_them="$result"
74
+		
75
+	Get_Translation "Updater for Minimal Ramize-Physave"
76
+		I18n____Updater_for_Minimal_Ramize_Physave="$result"
77
+		
78
+	Get_Translation "Error"
79
+		I18n____Error="$result"
80
+
81
+}
82
+readonly -f Get_Translations_for____GUI
83
+
84
+# End of
85
+# Function
86
+############
0 87
new file mode 100755
... ...
@@ -0,0 +1,131 @@
1
+#!/bin/bash
2
+
3
+
4
+############
5
+# Function
6
+Console_Help_Message()
7
+{
8
+	#----
9
+	local message
10
+	
11
+	local This_Script_Desc
12
+	local This_Script_Usage
13
+	
14
+	#@@@@	
15
+	Declare_Paths____Console_Help_Text
16
+	
17
+	This_Script_Desc=$(cat "$Fillepath____This_Script_Desc")
18
+	This_Script_Usage=$(cat "$Fillepath____This_Script_Usage")
19
+
20
+
21
+	##############################
22
+	
23
+	
24
+	message="
25
+$This_Script_Desc
26
+
27
+
28
+$This_Script_Usage"
29
+
30
+	echo "$message"
31
+	
32
+}
33
+readonly -f Console_Help_Message
34
+
35
+# End of
36
+# Function
37
+############
38
+
39
+
40
+
41
+############
42
+# Function
43
+Declare_Paths____Console_Help_Text()
44
+{
45
+	readonly Fillepath____This_Script_Desc="$Follpath____Translations/Console Help - Desc"
46
+	readonly Fillepath____This_Script_Usage="$Follpath____Translations/Console Help - Usage"
47
+}
48
+readonly -f Declare_Paths____Console_Help_Text
49
+
50
+# End of
51
+# Function
52
+############
53
+
54
+
55
+
56
+############
57
+# Function
58
+Figure_Out_Translation_To_Use()
59
+{
60
+	# 07:43:34 03/10/2018.  To change the language this script displays
61
+	# output in, run this command before running mkdirperms:
62
+	#
63
+	# 	export Language="Dog Language"
64
+	#
65
+	# 04:57:59 03/10/2018.  I don't understand any language other than English
66
+	# well enough to write a real translation, so the only other "language"
67
+	# available for now is Dog Language. :-)
68
+	#
69
+	#
70
+	# 01:13:14 03/30/2018.  No Dog Language in this app (yet?).
71
+	#
72
+	# See mkdirperms for an example of a complete Dog Language translation. :-)
73
+	#
74
+	# https://github.com/Apollia/mkdirperms
75
+	
76
+	
77
+	case "$Language" in
78
+		"Dog Language")
79
+			Translation_Lang="Dog Language"
80
+			;;
81
+		*)
82
+			Translation_Lang="English - US"
83
+			;;
84
+	esac
85
+}
86
+readonly -f Figure_Out_Translation_To_Use
87
+
88
+# End of
89
+# Function
90
+############
91
+
92
+
93
+
94
+############
95
+# Function
96
+Declare_Paths____Translation_Related()
97
+{
98
+	readonly Follpath____All_Translations="$Follpath____This_Script/Translations"
99
+
100
+		readonly Follpath____Translations="$Follpath____All_Translations/$Translation_Lang"
101
+
102
+			readonly Fillepath____Translation_Phrases="$Follpath____Translations/00-Phrases"
103
+	
104
+}
105
+readonly -f Declare_Paths____Translation_Related
106
+
107
+# End of
108
+# Function
109
+############
110
+
111
+
112
+
113
+
114
+#----------10:56:17 03/10/2018.  Boring clutter:
115
+
116
+
117
+############
118
+# Function
119
+Get_Translations_for____Console()
120
+{
121
+	Get_Translation "Succeeded"
122
+		I18n____Succeeded="$result"
123
+		
124
+	Get_Translation "Disk Image Mounter"
125
+		I18n____Disk_Image_Mounter="$result"
126
+}
127
+readonly -f Get_Translations_for____Console
128
+
129
+# End of
130
+# Function
131
+############
0 132
\ No newline at end of file
1 133
new file mode 100755
... ...
@@ -0,0 +1,73 @@
1
+#!/bin/bash
2
+
3
+
4
+
5
+############
6
+# Function
7
+ere_quote()
8
+{
9
+	# 00:35:04 03/13/2018.  The original version of this function was from:
10
+	#
11
+	# https://stackoverflow.com/questions/11856054/bash-easy-way-to-pass-a-raw-string-to-grep
12
+	
13
+	
14
+	# 00:16:49 03/13/2018.  The original code:
15
+	# sed 's/[]\.|$(){}?+*^]/\\&/g' <<< "$*"
16
+	
17
+	
18
+	# 00:31:23 03/13/2018.  In Lighthouse 64 Puppy Linux 6.02 Beta 2 - http://lhpup.org/ -
19
+	# my bash_unit tests of ere_quote showed me that the previous line wasn't escaping
20
+	# left brackets.
21
+	#
22
+	# This fixes that:
23
+	  sed 's/[]\.|$(){}?+*^\[]/\\&/g' <<< "$*"
24
+	 
25
+	 
26
+	# 00:34:05 03/13/2018.  bash_unit is a wonderful unit testing program for Bash.
27
+	#
28
+	# Here's my slightly modified version:
29
+	#
30
+	# https://github.com/Apollia/bash_unit
31
+}
32
+readonly -f ere_quote
33
+
34
+# End of
35
+# Function
36
+############
37
+
38
+
39
+
40
+############
41
+# Function
42
+Get_Translation()
43
+{
44
+	local keystring="$1"
45
+	
46
+	#----
47
+	local keystring_for_grep
48
+	local regex
49
+	
50
+	local partial_result
51
+	
52
+	#@@@@
53
+	keystring_for_grep=$(ere_quote "$keystring")
54
+	
55
+	regex="^$keystring_for_grep[[:blank:]][[:blank:]][[:blank:]]"
56
+	
57
+	
58
+	##############################
59
+	
60
+
61
+	partial_result=$(grep -E "$regex" "$Fillepath____Translation_Phrases" | awk --posix  -F '[[:space:]]{3}+' '{print $2}' | head -n 1)
62
+	
63
+	result="${partial_result#"${partial_result%%[![:space:]]*}"}"
64
+		# 07:20:28 03/10/2018.  A complicated-looking way to remove leading whitespace.
65
+		# From: 
66
+		#		#https://unix.stackexchange.com/questions/297500/removing-space-at-the-beginning-of-the-variable-data/297503#297503
67
+		
68
+}
69
+readonly -f Get_Translation
70
+
71
+# End of
72
+# Function
73
+############
0 74
\ No newline at end of file
1 75
new file mode 100755
2 76
Binary files /dev/null and b/Tools/Update dragdropped Minimal-Ramize Physave folder/Icons/Drop-48x48.png differ
3 77
new file mode 100755
... ...
@@ -0,0 +1,48 @@
1
+#! /bin/bash
2
+
3
+
4
+readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}")
5
+readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script" )
6
+
7
+
8
+# 20:20:51 03/27/2018.  This script assumes this app is in a ramized location,
9
+# so the symlink won't cause a physical disk to be pestered every time the
10
+# icon is needed.
11
+#
12
+# So, this script should not be run if this app is actually in a physaved location.
13
+
14
+
15
+Icon_Fillepath="$Follpath____This_Script/Drop-48x48.png"
16
+
17
+position_of_symlink="/usr/share/icons/hicolor/48x48/apps/Drop-48x48.png"
18
+
19
+
20
+if [ ! -e "$position_of_symlink" ]
21
+then
22
+	if [ ! -L "$position_of_symlink" ]
23
+	then
24
+		ln --symbolic "$Icon_Fillepath" "$position_of_symlink"
25
+		
26
+		gtk-update-icon-cache -f -i /usr/share/icons/hicolor/
27
+		
28
+		
29
+		#!!!!
30
+		exit 0
31
+	else
32
+		echo "Nothing done, a symlink already existed at:
33
+	
34
+	$position_of_symlink"
35
+		
36
+		
37
+		#!!!!
38
+		exit 1
39
+	fi
40
+else
41
+	echo "Nothing done - something already existed at:
42
+
43
+	$position_of_symlink"
44
+	
45
+	
46
+		#!!!!
47
+		exit 2
48
+fi
0 49
\ No newline at end of file
1 50
new file mode 100755
... ...
@@ -0,0 +1,34 @@
1
+#! /bin/bash
2
+
3
+
4
+readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}")
5
+readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script" )
6
+
7
+
8
+# 20:20:51 03/27/2018.  This script assumes this app is in a ramized location,
9
+# so the symlink won't cause a physical disk to be pestered every time the
10
+# icon is needed.
11
+#
12
+# So, this script should not be run if this app is actually in a physaved location.
13
+
14
+
15
+Icon_Fillepath="$Follpath____This_Script/Drop-48x48.png"
16
+
17
+position_of_symlink="/usr/share/icons/hicolor/48x48/apps/Drop-48x48.png"
18
+
19
+
20
+if [ -L "$position_of_symlink" ]
21
+then
22
+	unlink "$position_of_symlink"
23
+	
24
+	gtk-update-icon-cache -f -i /usr/share/icons/hicolor/
25
+
26
+else
27
+	echo "Nothing done - already, there was no symlink at:
28
+
29
+	$position_of_symlink"
30
+	
31
+	
32
+	#!!!!
33
+	exit 1
34
+fi
0 35
\ No newline at end of file
1 36
new file mode 100755
... ...
@@ -0,0 +1,20 @@
1
+
2
+# 01:47:14 03/11/2018.  This is a comment just to prove that comments are allowed in
3
+# 00-Phrases files, and won't break anything as long as they don't contain 3 or more
4
+# spaces and/or tabs in a row somewhere in the middle of the line.
5
+
6
+Comments actually don't even need to begin with a # or anything else,
7
+but it might be best to begin them with something, so it's clearer
8
+at a glance that they're comments.
9
+
10
+			# You can also indent your comments to any depth, but only if the line
11
+			# begins with a space or tab.
12
+			
13
+----
14
+
15
+Updater for Minimal Ramize-Physave			Updater for Minimal Ramize-Physave
16
+
17
+Dragdrop Minimal Ramize-Physave folders into this box to update them			Dragdrop Minimal Ramize-Physave folders into this box to update them
18
+
19
+Error						Error
20
+Succeeded					Succeeded
0 21
new file mode 100755
... ...
@@ -0,0 +1,2 @@
1
+Updater for Minimal Ramize-Physave
2
+
0 3
new file mode 100755
... ...
@@ -0,0 +1 @@
1
+Usage: 
0 2
\ No newline at end of file
1 3
new file mode 100644
... ...
@@ -0,0 +1,45 @@
1
+#!/bin/bash
2
+
3
+
4
+readonly Fillepath____This_Script=$(realpath "${BASH_SOURCE[0]}")
5
+readonly Follpath____This_Script=$(dirname "$Fillepath____This_Script" )
6
+
7
+#-------------------------------------------------------------------------------
8
+
9
+readonly Follpath____Helpers="$Follpath____This_Script/Helpers"
10
+	readonly Fillepath____This_App_s_GUI="$Follpath____Helpers/This App's GUI"
11
+		source "$Fillepath____This_App_s_GUI"
12
+
13
+cd "$Follpath____This_Script"
14
+
15
+
16
+Follpath____Official_Minimal_Ramize_Physave="/root/apbin/Ramize-Physave/Default-Version/Minimal Ramize-Physave"
17
+
18
+
19
+	readonly Fillepath____Translation_Functions="$Follpath____Helpers/Translation Functions"
20
+		source "$Fillepath____Translation_Functions"
21
+	
22
+	readonly Fillepath____This_App_s_GUI_Translations="$Follpath____Helpers/This App's GUI Translations"	
23
+		source "$Fillepath____This_App_s_GUI_Translations"
24
+	
25
+	readonly Fillepath____Message_Functions="$Follpath____Helpers/Message Functions"
26
+		source "$Fillepath____Message_Functions"
27
+		
28
+	Figure_Out_Translation_To_Use
29
+
30
+	Declare_Paths____Translation_Related
31
+
32
+	Get_Translations_for____GUI
33
+	
34
+if [ -z "$1" ]
35
+then
36
+	Prepare_GUI
37
+	exit 0
38
+fi
39
+
40
+
41
+for arg in "$@"
42
+do
43
+	echo "Arg: $arg"
44
+    Update_if_this_is_a_Minimal_Ramize_Physave_folder "$arg"
45
+done