Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE-old
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
Vladislav
PortWINE-old
Commits
e90b8aa2
Unverified
Commit
e90b8aa2
authored
Jul 18, 2024
by
Boris Yumankulov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply patch from
@Htylol
parent
bfbe8430
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
20 deletions
+47
-20
functions_helper
data_from_portwine/scripts/functions_helper
+47
-20
No files found.
data_from_portwine/scripts/functions_helper
View file @
e90b8aa2
...
...
@@ -999,6 +999,18 @@ stop_portwine () {
kill
-s
SIGUSR1
"
$(
pgrep
-a
yad_gui_pp |
grep
"
\-
-notification"
|
awk
'{print $1}'
)
"
2>/dev/null
fi
for
check
in
${
PORT_WINE_PATH
}
/
*
.desktop
;
do
SHORTCUT_SKIP_LIST+
=
"
$check
"
done
SHORTCUT_SKIP_LIST
=
"
${
SHORTCUT_SKIP_LIST
//
"
${
PORT_WINE_PATH
}
/"
/
""
}
"
if
[[
${
SHORTCUT_SKIP_LIST
}
!=
"*.desktop"
]]
;
then
SHORTCUT_SKIP_LIST
=
"
${
SHORTCUT_SKIP_LIST
//
" "
/
"*"
}
"
SHORTCUT_SKIP_LIST
=
"
${
SHORTCUT_SKIP_LIST
//
".desktop"
/
".lnk "
}
"
for
skip
in
${
SHORTCUT_SKIP_LIST
}
;
do
SHORTCUT_SKIP_LIST_NEW+
=
"-not -name "
${
skip
}
" "
done
fi
for
prefix_dir
in
"
${
PORT_WINE_PATH
}
"
/prefixes/
*
;
do
DESKTOP_DIRS+
=(
"
${
prefix_dir
}
/drive_c/users/steamuser/Desktop"
...
...
@@ -1009,28 +1021,43 @@ stop_portwine () {
for
dir
in
"
${
DESKTOP_DIRS
[@]
}
"
;
do
while
IFS
=
read
-r
-d
''
link_file
;
do
LINKS+
=(
"
$link_file
"
)
done
< <
(
find
"
$dir
"
-type
f
-iname
"*.lnk"
-print0
2>/dev/null |
sort
-u
)
done
< <
(
find
"
$dir
"
-type
f
-iname
"*.lnk"
${
SHORTCUT_SKIP_LIST_NEW
}
-print0
2>/dev/null |
sort
-u
)
done
for
link_file
in
"
${
LINKS
[@]
}
"
;
do
if
command
-v
exiftool &>/dev/null
link_drive
=
$(
exiftool
-LocalBasePath
"
$link_file
"
|
sed
-n
's/^Local Base Path\s*:\s*//p'
|
cut
-d
:
-f1
|
awk
'{print tolower($0)}'
)
link_path
=
$(
exiftool
-LocalBasePath
"
$link_file
"
|
sed
-n
's/^Local Base Path\s*:\s*//p'
|
sed
's|%ProgramFiles(x86)%|C:\\Program Files (x86)|gi;s|%ProgramFiles%|C:\\Program Files|gi'
|
sed
"s|^.|
${
PORT_WINE_PATH
}
/data/prefixes/
$PW_PREFIX_NAME
/dosdevices/
$link_drive
|g"
|
sed
's/\\/\//g'
)
link_name
=
$(
exiftool
-FileName
"
$link_file
"
|
sed
-n
's/^File Name\s*:\s*//p'
|
sed
's|\.lnk||'
)
link_cmd
=
$(
exiftool
-CommandLineArguments
"
$link_file
"
|
sed
-n
's/^Command Line Arguments\s*:\s*//p'
)
if
timeout
3 exiftool
"
$link_file
"
2>/dev/null
>
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
;
then
prefix_name
=
$(
echo
$link_file
|
awk
-F
"/prefixes/"
'{print $2}'
|
awk
-F
"/"
'{print $1}'
)
if
grep
-i
"Icon File Name"
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
;
then
link_drive
=
$(
sed
-n
's/^Icon File Name\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
|
cut
-d
:
-f1
|
awk
'{print tolower($0)}'
)
link_path
=
$(
sed
-n
's/^Icon File Name\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
|
sed
's|%ProgramFiles(x86)%|C:\\Program Files (x86)|gi;s|%ProgramFiles%|C:\\Program Files|gi'
|
sed
"s|^.|
${
PORT_WINE_PATH
}
/data/prefixes/
$prefix_name
/dosdevices/
$link_drive
|g"
|
sed
's/\\/\//g'
)
else
link_drive
=
$(
sed
-n
's/^Local Base Path\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
|
cut
-d
:
-f1
|
awk
'{print tolower($0)}'
)
link_path
=
$(
sed
-n
's/^Local Base Path\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
|
sed
's|%ProgramFiles(x86)%|C:\\Program Files (x86)|gi;s|%ProgramFiles%|C:\\Program Files|gi'
|
sed
"s|^.|
${
PORT_WINE_PATH
}
/data/prefixes/
$prefix_name
/dosdevices/
$link_drive
|g"
|
sed
's/\\/\//g'
)
fi
link_name
=
$(
sed
-n
's/^File Name\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
|
sed
's|\.lnk||'
)
link_cmd
=
$(
sed
-n
's/^Command Line Arguments\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
)
echo
$link_path
else
link_drive
=
$(
env
PERL5LIB
=
"
${
PW_PLUGINS_PATH
}
/portable/lib/perl5"
"
${
PW_PLUGINS_PATH
}
/portable/bin/exiftool"
-LocalBasePath
"
$link_file
"
|
sed
-n
's/^Local Base Path\s*:\s*//p'
|
cut
-d
:
-f1
|
awk
'{print tolower($0)}'
)
link_path
=
$(
env
PERL5LIB
=
"
${
PW_PLUGINS_PATH
}
/portable/lib/perl5"
"
${
PW_PLUGINS_PATH
}
/portable/bin/exiftool"
-LocalBasePath
"
$link_file
"
|
sed
-n
's/^Local Base Path\s*:\s*//p'
|
sed
's|%ProgramFiles(x86)%|C:\\Program Files (x86)|gi;s|%ProgramFiles%|C:\\Program Files|gi'
|
sed
"s|^.|
${
PORT_WINE_PATH
}
/data/prefixes/
$PW_PREFIX_NAME
/dosdevices/
$link_drive
|g"
|
sed
's/\\/\//g'
)
link_name
=
$(
env
PERL5LIB
=
"
${
PW_PLUGINS_PATH
}
/portable/lib/perl5"
"
${
PW_PLUGINS_PATH
}
/portable/bin/exiftool"
-FileName
"
$link_file
"
|
sed
-n
's/^File Name\s*:\s*//p'
|
sed
's|\.lnk||'
)
link_cmd
=
$(
env
PERL5LIB
=
"
${
PW_PLUGINS_PATH
}
/portable/lib/perl5"
"
${
PW_PLUGINS_PATH
}
/portable/bin/exiftool"
-CommandLineArguments
"
$link_file
"
|
sed
-n
's/^Command Line Arguments\s*:\s*//p'
)
fi
exe_path
=
"
$(
realpath
"
$link_path
"
)
"
if
!
[[
"
$(
grep
-il
"
${
exe_path
}
"
"
${
PORT_WINE_PATH
}
"
/
*
.desktop
)
"
]]
||
\
!
[[
"
$(
grep
-il
"
${
exe_path
}
"
"
${
HOME
}
/.local/share/applications"
/
*
.desktop
)
"
]]
||
\
!
[[
"
$(
grep
-il
"
${
exe_path
}
"
"
$(
xdg-user-dir DESKTOP
)
"
/
*
.desktop
)
"
]]
;
then
create_shortcut_from_link
print_info
"Created link for
$link_name
"
if
!
command
-v
exiftool &>/dev/null
;
then
print_warning
"use portable exiftool"
prefix_name
=
$(
echo
$link_file
|
awk
-F
"/prefixes/"
'{print $2}'
|
awk
-F
"/"
'{print $1}'
)
env
PERL5LIB
=
"
${
PW_PLUGINS_PATH
}
/portable/lib/perl5"
"
${
PW_PLUGINS_PATH
}
/portable/bin/exiftool"
"
$link_file
"
2>/dev/null
>
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
if
grep
-i
"Icon File Name"
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
;
then
link_drive
=
$(
sed
-n
's/^Icon File Name\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
|
cut
-d
:
-f1
|
awk
'{print tolower($0)}'
)
link_path
=
$(
sed
-n
's/^Icon File Name\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
|
sed
's|%ProgramFiles(x86)%|C:\\Program Files (x86)|gi;s|%ProgramFiles%|C:\\Program Files|gi'
|
sed
"s|^.|
${
PORT_WINE_PATH
}
/data/prefixes/
$prefix_name
/dosdevices/
$link_drive
|g"
|
sed
's/\\/\//g'
)
else
link_drive
=
$(
sed
-n
's/^Local Base Path\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
|
cut
-d
:
-f1
|
awk
'{print tolower($0)}'
)
link_path
=
$(
sed
-n
's/^Local Base Path\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
|
sed
's|%ProgramFiles(x86)%|C:\\Program Files (x86)|gi;s|%ProgramFiles%|C:\\Program Files|gi'
|
sed
"s|^.|
${
PORT_WINE_PATH
}
/data/prefixes/
$prefix_name
/dosdevices/
$link_drive
|g"
|
sed
's/\\/\//g'
)
fi
link_name
=
$(
sed
-n
's/^File Name\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
|
sed
's|\.lnk||'
)
link_cmd
=
$(
sed
-n
's/^Command Line Arguments\s*:\s*//p'
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
)
else
yad_error
"exiftool - broken!"
fi
fi
exe_path
=
"
$(
realpath
"
${
link_path
}
"
)
"
create_shortcut_from_link
print_info
"Created link for
$link_name
"
done
add_in_stop_portwine
...
...
@@ -1329,7 +1356,7 @@ check_nvidia_rtx () {
return
1
}
create_shortcut_from_link
()
{
create_shortcut_from_link
()
{
PORTPROTON_NAME
=
"
$link_name
"
PW_RESIZE_TO
=
128
...
...
@@ -1340,12 +1367,12 @@ create_shortcut_from_link(){
if
[[
!
-f
"
${
PORT_WINE_PATH
}
/data/img/
${
PORTPROTON_NAME
}
.png"
]]
;
then
if
command
-v
exe-thumbnailer &>/dev/null
;
then
exe-thumbnailer
-s
128
"
$(
readlink
-f
"
${
portwine_exe
}
"
)
"
"
${
PORT_WINE_PATH
}
/data/img/
${
PORTPROTON_NAME
}
.png"
exe-thumbnailer
-s
128
"
$(
readlink
-f
"
${
exe_path
}
"
)
"
"
${
PORT_WINE_PATH
}
/data/img/
${
PORTPROTON_NAME
}
.png"
else
env
PYTHONPATH
=
"
${
PW_PLUGINS_PATH
}
/portable/lib/python3.9/site-packages/"
\
LD_LIBRARY_PATH
=
"
${
PW_PLUGINS_PATH
}
/portable/lib/lib64"
\
"
${
PW_WINELIB
}
/runtime/files/bin/python3.9"
\
"
${
PW_PLUGINS_PATH
}
/portable/bin/exe-thumbnailer"
-s
128
"
$(
readlink
-f
"
${
portwine_exe
}
"
)
"
"
${
PORT_WINE_PATH
}
/data/img/
${
PORTPROTON_NAME
}
.png"
"
${
PW_PLUGINS_PATH
}
/portable/bin/exe-thumbnailer"
-s
128
"
$(
readlink
-f
"
${
exe_path
}
"
)
"
"
${
PORT_WINE_PATH
}
/data/img/
${
PORTPROTON_NAME
}
.png"
fi
fi
...
...
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