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
5b1f4a23
Commit
5b1f4a23
authored
Nov 18, 2024
by
Alex Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove get_images.sh
parent
29dc8d02
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
127 deletions
+1
-127
add_in_steam.sh
data_from_portwine/scripts/add_in_steam.sh
+0
-0
functions_helper
data_from_portwine/scripts/functions_helper
+1
-45
get_images.sh
data_from_portwine/scripts/get_images.sh
+0
-82
No files found.
data_from_portwine/scripts/add_in_steam.sh
View file @
5b1f4a23
This diff is collapsed.
Click to expand it.
data_from_portwine/scripts/functions_helper
View file @
5b1f4a23
...
...
@@ -6009,52 +6009,8 @@ portwine_output_yad_shortcut () {
fi
if [[ "${PW_SHORTCUT_STEAM}" == "TRUE" ]] ; then
SLUF="${HOME}/.local/share/Steam/config/loginusers.vdf"
if [[ -f "${SLUF}" ]]; then
SLUFUB=false
STUID64=""
while read -r line; do
if [[ "${line}" =~ ^[[:space:]]*\"([0-9]+)\"$ ]]; then
STUIDCUR="${BASH_REMATCH[1]}"
SLUFUB=true
elif [[ "${line}" == *'
"MostRecent"
'*'
"1"
' && ${SLUFUB} = true ]]; then
STUID64="${STUIDCUR}"
break
elif [[ "${line}" == "}" ]]; then
SLUFUB=false
fi
done < "${SLUF}"
if [ -n "${STUID64}" ]; then
STUID32=$((STUID64 - 76561197960265728))
STUIDPATH="${HOME}/.local/share/Steam/userdata/${STUID32}"
if [[ -d "${STUIDPATH}" ]]; then
export SCPATH="${STUIDPATH}/config/shortcuts.vdf"
if [[ -f "${SCPATH}" ]]; then
export STEAM_SCRIPTS="${PORT_WINE_PATH}/steam_scripts"
create_new_dir "${STEAM_SCRIPTS}"
create_new_dir "${STUIDPATH}/config/"
create_new_dir "${STUIDPATH}/config/grid"
export SGGRIDDIR="${STUIDPATH}/config/grid"
# shellcheck source=/dev/null
source "${PORT_SCRIPTS_PATH}/add_in_steam.sh"
if [[ "${PW_SKIP_RESTART_STEAM}" != 1 ]] && pgrep -i steam &>/dev/null ; then
if yad_question "${translations[For adding shortcut to STEAM, needed restart.\\n\\nRestart STEAM now?]}" ; then
pw_start_progress_bar_block "${translations[Restarting STEAM... Please wait.]}"
kill -s SIGTERM $(pgrep -a steam) &>/dev/null
while pgrep -i steam &>/dev/null ; do
sleep 0.5
done
steam &
sleep 5
pw_stop_progress_bar
exit 0
fi
fi
unset PW_SKIP_RESTART_STEAM
fi
fi
fi
fi
addNonSteamGame
fi
export PW_NEW_DESKTOP="1"
...
...
data_from_portwine/scripts/get_images.sh
deleted
100755 → 0
View file @
29dc8d02
#!/bin/bash
# AppName= AppId= SteamAppId= SteamGridDBId= SGGRIDDIR= ./get_images.sh
if
[[
-z
"
${
SGDBAPIKEY
}
"
||
-z
"
${
BASESTEAMGRIDDBAPI
}
"
]]
;
then
source
"
${
PORT_SCRIPTS_PATH
:-$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)}
/var"
fi
downloadImage
()
{
local
path
=
"
${
SGGRIDDIR
:-${
PWD
}}
"
local
url
=
"
$1
"
local
files
=(
"
$2
"
)
local
cur
=
''
;
if
[[
-n
"
${
url
}
"
&&
-n
"
${
files
}
"
]]
;
then
for
file
in
${
files
[@]
}
;
do
if
[[
-z
"
$cur
"
]]
;
then
if
!
curl
-Lf
# -o "${path}/${file}" "${url}"; then
return
1
fi
else
cp
"
${
path
}
/
${
cur
}
"
"
${
path
}
/
${
file
}
"
fi
cur
=
"
${
file
}
"
done
fi
}
downloadImageSteam
()
{
if
[[
-n
"
${
SteamAppId
}
"
]]
;
then
downloadImage
"https://cdn.cloudflare.steamstatic.com/steam/apps/
$1
"
"
$2
"
else
return
1
fi
}
downloadImageSteamGridDB
()
{
if
[[
-n
"
${
SteamGridDBId
}
"
&&
-n
"
${
SGDBAPIKEY
}
"
]]
;
then
SGDBIMGAPI
=
"
${
BASESTEAMGRIDDBAPI
}
/
$1
?limit=1"
[[
-n
"
$3
"
]]
&&
SGDBIMGAPI+
=
"&
$3
"
[[
-n
"
$4
"
]]
&&
SGDBIMGAPI+
=
"&
$4
"
SGDBIMGRES
=
$(
curl
-Ls
-H
"Authorization: Bearer
${
SGDBAPIKEY
}
"
"
${
SGDBIMGAPI
}
"
)
if
jq
-e
".success == true and (.data | length > 0)"
<<<
"
${
SGDBIMGRES
}
"
>
/dev/null 2>&1
;
then
SGDBIMGURL
=
$(
jq
-r
'.data[0].url'
<<<
"
${
SGDBIMGRES
}
"
)
downloadImage
"
${
SGDBIMGURL
}
"
"
$2
"
elif
[[
-n
"
$3
"
]]
;
then
downloadImageSteamGridDB
"
$1
"
"
$2
"
""
"
$4
"
else
return
1
fi
else
return
1
fi
}
getSteamId
()
{
SRES
=
$(
curl
-Ls
-e
"https://www.steamgriddb.com/game/
${
SteamGridDBId
}
"
"https://www.steamgriddb.com/api/public/game/
${
SteamGridDBId
}
"
)
if
jq
-e
".success == true"
<<<
"
${
SRES
}
"
>
/dev/null 2>&1
;
then
export
SteamAppId
=
"
$(
jq
-r
'.data.platforms.steam.id'
<<<
"
${
SRES
}
"
)
"
fi
}
getSteamGridDBId
()
{
SGDBRES
=
$(
curl
-Ls
-H
"Authorization: Bearer
${
SGDBAPIKEY
}
"
"
${
BASESTEAMGRIDDBAPI
}
/search/autocomplete/
${
AppName
// /_
}
"
)
if
jq
-e
".success == true and (.data | length > 0)"
<<<
"
${
SGDBRES
}
"
>
/dev/null 2>&1
;
then
export
SteamGridDBId
=
"
$(
jq
'.data[0].id'
<<<
"
${
SGDBRES
}
"
)
"
if
jq
-e
'.data[0].types | contains(["steam"])'
<<<
"
${
SGDBRES
}
"
>
/dev/null
;
then
getSteamId
fi
fi
}
if
[[
-z
"
${
SteamAppId
}
"
&&
-z
"
${
SteamGridDBId
}
"
&&
-n
"
${
AppName
}
"
&&
-n
"
${
SGDBAPIKEY
}
"
]]
;
then
getSteamGridDBId
fi
if
[[
-n
"
${
SteamAppId
}
"
]]
||
[[
-n
"
${
SteamGridDBId
}
"
&&
-n
"
${
SGDBAPIKEY
}
"
]]
;
then
downloadImageSteam
"
${
SteamAppId
}
/header.jpg"
"
${
AppId
:-
0
}
.jpg"
||
downloadImageSteamGridDB
"grids/game/
${
SteamGridDBId
}
"
"
${
AppId
:-
0
}
.jpg"
"mimes=image/jpeg"
"dimensions=460x215,920x430"
||
echo
"Failed to load header.jpg"
downloadImageSteam
"
${
SteamAppId
}
/library_600x900_2x.jpg"
"
${
AppId
:-
0
}
p.jpg"
||
downloadImageSteamGridDB
"grids/game/
${
SteamGridDBId
}
"
"
${
AppId
:-
0
}
p.jpg"
"mimes=image/jpeg"
"dimensions=600x900,660x930"
||
echo
"Failed to load library_600x900_2x.jpg"
downloadImageSteam
"
${
SteamAppId
}
/library_hero.jpg"
"
${
AppId
:-
0
}
_hero.jpg"
||
downloadImageSteamGridDB
"heroes/game/
${
SteamGridDBId
}
"
"
${
AppId
:-
0
}
_hero.jpg"
"mimes=image/jpeg"
||
echo
"Failed to load library_hero.jpg"
downloadImageSteam
"
${
SteamAppId
}
/logo.png"
"
${
AppId
:-
0
}
_logo.png"
||
downloadImageSteamGridDB
"logos/game/
${
SteamGridDBId
}
"
"
${
AppId
:-
0
}
_logo.png"
"mimes=image/png"
||
echo
"Failed to load logo.png"
else
echo
"Game is not found"
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