Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Tergoev
PortWINE
Commits
8eb41a01
Commit
8eb41a01
authored
Oct 07, 2024
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes bugs ..
parent
0b963639
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
45 deletions
+51
-45
functions_helper
data_from_portwine/scripts/functions_helper
+48
-39
start.sh
data_from_portwine/scripts/start.sh
+3
-6
No files found.
data_from_portwine/scripts/functions_helper
View file @
8eb41a01
...
@@ -779,8 +779,9 @@ debug_timer () {
...
@@ -779,8 +779,9 @@ debug_timer () {
search_desktop_file
()
{
search_desktop_file
()
{
# Поиск нужного .desktop файла по $portwine_exe, чтобы внести изменения в него.
# Поиск нужного .desktop файла по $portwine_exe, чтобы внести изменения в него.
for
desktop_file
in
"
${
PORT_WINE_PATH
}
"
/
*
;
do
for
desktop_file
in
"
${
PORT_WINE_PATH
}
"
/
*
;
do
if
[[
$desktop_file
=
~ .desktop
]]
;
then
desktop_file_new
=
"
${
desktop_file
//
"
${
PORT_WINE_PATH
}
/"
/
}
"
if
[[
!
$desktop_file
=
~
(
/PortProton|/readme
)
]]
;
then
if
[[
$desktop_file_new
=
~ .desktop
]]
;
then
if
[[
!
$desktop_file_new
=
~
(
PortProton|readme
)
]]
;
then
while
IFS
=
read
-r
line
;
do
while
IFS
=
read
-r
line
;
do
if
[[
$line
=
~ ^Exec
=
]]
;
then
if
[[
$line
=
~ ^Exec
=
]]
;
then
if
check_flatpak
;
then
if
check_flatpak
;
then
...
@@ -794,18 +795,20 @@ search_desktop_file () {
...
@@ -794,18 +795,20 @@ search_desktop_file () {
if [[
$line
=~ ^#Time= ]] ; then
if [[
$line
=~ ^#Time= ]] ; then
if [[
$portwine_exe
==
"
$EXEC_DESKTOP_NEW
"
]] ; then
if [[
$portwine_exe
==
"
$EXEC_DESKTOP_NEW
"
]] ; then
TIME_CURRENT=
${
line
//#Time=/
}
TIME_CURRENT=
${
line
//#Time=/
}
if [[ !
$TIME_CURRENT
=~ [0-9]+ ]] ; then
TIME_CURRENT=
"0"
sed -i
'/^#Time=/d'
"
$desktop_file
"
echo
"#Time=0"
>>
"
$desktop_file
"
fi
fi
fi
fi
fi
done <
"
$desktop_file
"
done <
"
$desktop_file
"
if [[ -n
$PW_TIME_IN_GAME
]] ; then
if [[
$portwine_exe
==
"
$EXEC_DESKTOP_NEW
"
]] ; then
TIME_TOTAL=
$((
TIME_CURRENT
+
PW_TIME_IN_GAME
))
if [[ !
$TIME_CURRENT
=~ [0-9]+ ]] ; then
sed -i
'/^#Time=/d'
"
$desktop_file
"
TIME_CURRENT=
"0"
echo
"#Time=
$TIME_TOTAL
"
>>
"
$desktop_file
"
sed -i
'/^#Time=/d'
"
$desktop_file
"
echo
"#Time=0"
>>
"
$desktop_file
"
fi
if [[ -n
$PW_TIME_IN_GAME
]] ; then
TIME_TOTAL=
$((
TIME_CURRENT
+
PW_TIME_IN_GAME
))
sed -i
'/^#Time=/d'
"
$desktop_file
"
echo
"#Time=
$TIME_TOTAL
"
>>
"
$desktop_file
"
fi
fi
fi
fi
fi
fi
fi
...
@@ -814,51 +817,57 @@ search_desktop_file () {
...
@@ -814,51 +817,57 @@ search_desktop_file () {
}
}
seconds_to_time () {
seconds_to_time () {
[[ -z
$1
]] && return
1
[[ -z
$1
]] && return
0
local seconds=
$1
local seconds=
$1
# Calculate days
local days=
$((
seconds
/
(
60
*
60
*
24
))
)
local seconds=
$((
seconds
%
(
60
*
60
*
24
))
)
# Calculate hours
local hours=
$((
seconds
/
(
60
*
60
))
)
local seconds=
$((
seconds
%
(
60
*
60
))
)
# Calculate minutes
local minutes=
$((
seconds
/
60
))
local minutes=
$((
seconds
/
60
))
local hours=
$((
minutes
/
60
))
local seconds=
$((
seconds
%
60
))
local days=
$((
hours
/
24
))
local remaining_minutes=
$((
minutes
%
60
))
local remaining_hours=
$((
hours
%
24
))
if [[
$days
=~ ^0
$
]] ; then
if [[
$days
=~ ^0
$
]] ; then
local
remaining_
days=
local days=
elif [[
$days
=~ ^1
$
]] ; then
elif [[
$days
=~ ^1
$
]] ; then
local
remaining_
days=
"
$days
${
translations
[day]
}
, "
local days=
"
$days
${
translations
[day]
}
, "
elif [[
$days
=~ ^([2-9]1|[1-9][0-9]+1)
$
]] && [[
$LANGUAGE
= ru ]] ; then
elif [[
$days
=~ ^([2-9]1|[1-9][0-9]+1)
$
]] && [[
$LANGUAGE
= ru ]] ; then
local
remaining_
days=
"
$days
${
translations
[day]
}
, "
local days=
"
$days
${
translations
[day]
}
, "
elif [[
$days
=~ ^(
2|3|4|[2-9]2|[2-9]3|[2-9]4|[1-9][0-9]+2|[1-9][0-9]+3|[1-9][0-9]+4
)
$
]] \
elif [[
$days
=~ ^(
[2-4]|[2-9][2-4]|[1-9][0-9]+[2-4]
)
$
]] \
&& [[
$LANGUAGE
= ru ]] ; then
&& [[
$LANGUAGE
= ru ]] ; then
local
remaining_
days=
"
$days
дня, "
local days=
"
$days
дня, "
else
else
local
remaining_
days=
"
$days
${
translations
[days]
}
, "
local days=
"
$days
${
translations
[days]
}
, "
fi
fi
if [[
$
remaining_
hours
=~ ^0
$
]] ; then
if [[
$hours
=~ ^0
$
]] ; then
local
remaining_
hours=
local hours=
elif [[
$
remaining_
hours
=~ ^1
$
]] ; then
elif [[
$hours
=~ ^1
$
]] ; then
local
remaining_
hours=
"
$hours
${
translations
[hour]
}
${
translations
[and]
}
"
local hours=
"
$hours
${
translations
[hour]
}
${
translations
[and]
}
"
elif [[
$
remaining_hours
=~ ^(2|3|4|22|23|24
)
$
]] && [[
$LANGUAGE
= ru ]] ; then
elif [[
$
hours
=~ ^([2-4]|2[2-4]
)
$
]] && [[
$LANGUAGE
= ru ]] ; then
local
remaining_
hours=
"
$hours
часа
${
translations
[and]
}
"
local hours=
"
$hours
часа
${
translations
[and]
}
"
elif [[
$
remaining_
hours
=~ ^21
$
]] && [[
$LANGUAGE
= ru ]] ; then
elif [[
$hours
=~ ^21
$
]] && [[
$LANGUAGE
= ru ]] ; then
local
remaining_hours=
"
$hours
час
${
translations
[and]
}
"
local
hours=
"
$hours
${
translations
[hour]
}
${
translations
[and]
}
"
else
else
local
remaining_
hours=
"
$hours
${
translations
[hours]
}
${
translations
[and]
}
"
local hours=
"
$hours
${
translations
[hours]
}
${
translations
[and]
}
"
fi
fi
if [[
$
remaining_
minutes
=~ ^1
$
]] ; then
if [[
$minutes
=~ ^1
$
]] ; then
local
remaining_minutes=
"
$remaining_
minutes
${
translations
[minute]
}
"
local
minutes=
"
$
minutes
${
translations
[minute]
}
"
elif [[
$
remaining_
minutes
=~ ^[2-5]1
$
]] && [[
$LANGUAGE
= ru ]] ; then
elif [[
$minutes
=~ ^[2-5]1
$
]] && [[
$LANGUAGE
= ru ]] ; then
local
remaining_minutes=
"
$remaining_
minutes
${
translations
[minute]
}
"
local
minutes=
"
$
minutes
${
translations
[minute]
}
"
elif [[
$
remaining_minutes
=~ ^(2|3|4|[2-5]2|[2-5]3|[2-5]4
)
$
]] && [[
$LANGUAGE
= ru ]] ; then
elif [[
$
minutes
=~ ^([2-4]|[2-5][2-4]
)
$
]] && [[
$LANGUAGE
= ru ]] ; then
local
remaining_minutes=
"
$remaining_
minutes
минуты"
local
minutes=
"
$
minutes
минуты"
else
else
local
remaining_minutes=
"
$remaining_
minutes
${
translations
[minutes]
}
"
local
minutes=
"
$
minutes
${
translations
[minutes]
}
"
fi
fi
echo
"
\n
${
translations
[Time spent]
}
:
$remaining_days$remaining_hours$remaining_minutes
"
echo
-e
"<b>
\n
${
translations
[Time spent]
}
:
$days$hours$minutes
</b>
"
}
}
combobox_fix
()
{
combobox_fix
()
{
...
...
data_from_portwine/scripts/start.sh
View file @
8eb41a01
...
@@ -502,12 +502,12 @@ if [[ -f "${portwine_exe}" ]] ; then
...
@@ -502,12 +502,12 @@ if [[ -f "${portwine_exe}" ]] ; then
fi
fi
if
[[
-z
"
${
PW_COMMENT_DB
}
"
]]
;
then
if
[[
-z
"
${
PW_COMMENT_DB
}
"
]]
;
then
if
[[
-n
"
${
PORTPROTON_NAME
}
"
]]
;
then
if
[[
-n
"
${
PORTPROTON_NAME
}
"
]]
;
then
PW_COMMENT_DB
=
"
${
translations
[Launching]
}
<b>
$(
print_wrapped
"
${
PORTPROTON_NAME
}
"
"50"
)$(
seconds_to_time
$TIME_CURRENT
)
</b>"
PW_COMMENT_DB
=
"
${
translations
[Launching]
}
<b>
$(
print_wrapped
"
${
PORTPROTON_NAME
}
"
"50"
)$(
seconds_to_time
"
$TIME_CURRENT
"
)
</b>"
else
else
PW_COMMENT_DB
=
"
${
translations
[Launching]
}
<b>
$(
print_wrapped
"
${
PORTWINE_DB
}
"
"50"
)$(
seconds_to_time
$TIME_CURRENT
)
</b>"
PW_COMMENT_DB
=
"
${
translations
[Launching]
}
<b>
$(
print_wrapped
"
${
PORTWINE_DB
}
"
"50"
)$(
seconds_to_time
"
$TIME_CURRENT
"
)
</b>"
fi
fi
else
else
PW_COMMENT_DB
=
"
$PW_COMMENT_DB
$(
seconds_to_time
$TIME_CURRENT
)
"
PW_COMMENT_DB
=
"
$PW_COMMENT_DB
$(
seconds_to_time
"
$TIME_CURRENT
"
)
"
fi
fi
export
KEY_START
=
"
$RANDOM
"
export
KEY_START
=
"
$RANDOM
"
...
@@ -612,8 +612,6 @@ else
...
@@ -612,8 +612,6 @@ else
gui_userconf
gui_userconf
fi
fi
debug_timer
--start
# дропнуть и debug_timer --end ниже тоже
# Поиск .desktop файлов
# Поиск .desktop файлов
AMOUNT_GENERATE_BUTTONS
=
"0"
AMOUNT_GENERATE_BUTTONS
=
"0"
for
desktop_file
in
"
${
PORT_WINE_PATH
}
"
/
*
;
do
for
desktop_file
in
"
${
PORT_WINE_PATH
}
"
/
*
;
do
...
@@ -806,7 +804,6 @@ else
...
@@ -806,7 +804,6 @@ else
export
AI_SKIP
=
"1"
export
AI_SKIP
=
"1"
fi
fi
debug_timer
--end
IFS
=
"%"
IFS
=
"%"
"
${
pw_yad
}
"
--plug
=
$KEY_MENU
--tabnum
=
"
${
PW_GUI_SORT_TABS
[1]
}
"
--form
--columns
=
"
$MAIN_GUI_ROWS_EMULS
"
--align-buttons
--scroll
--homogeneous-column
\
"
${
pw_yad
}
"
--plug
=
$KEY_MENU
--tabnum
=
"
${
PW_GUI_SORT_TABS
[1]
}
"
--form
--columns
=
"
$MAIN_GUI_ROWS_EMULS
"
--align-buttons
--scroll
--homogeneous-column
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment