Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modding: Update .desktop file generation #756

Merged
merged 11 commits into from
Mar 6, 2023
1 change: 1 addition & 0 deletions lang/chinese.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ GUI_GSHDRITMTGTNITS="HDR Inverse Tone Mapping Target Nits"
DESC_GSHDRITMTGTNITS="set the target luninance of the inverse tone mapping process - Max is 10000 nits"
GUI_GSRT="Use Realtime Scheduling"
DESC_GSRT="enable GameScope realtime scheduling"
GUI_MODTOOLINVALIDUSAGE="It looks like you might be trying to launch 'XXX' using a desktop menu entry. This is not correct, please launch 'XXX' using the relevant start command from the command line, or through the SteamTinkerLaunch UI."
GUI_SDLUSEWAYLAND="SDL Wayland video driver"
DESC_SDLUSEWAYLAND="enables native Wayland support for SDL games that support it with SDL_VIDEODRIVER=wayland"
GUI_SGATITLE="Set Artwork for Game 'XXX (YYY)'"
Expand Down
3 changes: 2 additions & 1 deletion lang/dutch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ GUI_GSHDRITMTGTNITS="HDR Inverse Tone Mapping Target Nits"
DESC_GSHDRITMTGTNITS="set the target luninance of the inverse tone mapping process - Max is 10000 nits"
GUI_GSRT="Use Realtime Scheduling"
DESC_GSRT="enable GameScope realtime scheduling"
GUI_MODTOOLINVALIDUSAGE="It looks like you might be trying to launch 'XXX' using a desktop menu entry. This is not correct, please launch 'XXX' using the relevant start command from the command line, or through the SteamTinkerLaunch UI."
GUI_SDLUSEWAYLAND="SDL Wayland video driver"
DESC_SDLUSEWAYLAND="enables native Wayland support for SDL games that support it with SDL_VIDEODRIVER=wayland"
GUI_SGATITLE="Set Artwork for Game 'XXX (YYY)'"
Expand All @@ -1142,4 +1143,4 @@ DESC_SGABOXART="Box Art to be displayed in library / collections - Recommended r
GUI_SGATENFOOT="Tenfoot (Recently Played banner)"
DESC_SGATENFOOT="Banner that appears in library overview when a game is the most recently played - Recommended resolution of 600x350"
GUI_SGASETACTION="Artwork Set Method"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
3 changes: 2 additions & 1 deletion lang/english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ GUI_GSHDRITMTGTNITS="HDR Inverse Tone Mapping Target Nits"
DESC_GSHDRITMTGTNITS="set the target luninance of the inverse tone mapping process - Max is 10000 nits"
GUI_GSRT="Use Realtime Scheduling"
DESC_GSRT="enable GameScope realtime scheduling"
GUI_MODTOOLINVALIDUSAGE="It looks like you might be trying to launch 'XXX' using a desktop menu entry. This is not correct, please launch 'XXX' using the relevant start command from the command line, or through the SteamTinkerLaunch UI."
GUI_SDLUSEWAYLAND="SDL Wayland video driver"
DESC_SDLUSEWAYLAND="enables native Wayland support for SDL games that support it with SDL_VIDEODRIVER=wayland"
GUI_SGATITLE="Set Artwork for Game 'XXX (YYY)'"
Expand All @@ -1143,4 +1144,4 @@ DESC_SGABOXART="Box Art to be displayed in library / collections - Recommended r
GUI_SGATENFOOT="Tenfoot (Recently Played banner)"
DESC_SGATENFOOT="Banner that appears in library overview when a game is the most recently played - Recommended resolution of 600x350"
GUI_SGASETACTION="Artwork Set Method"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
3 changes: 2 additions & 1 deletion lang/englishUK.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ GUI_GSHDRITMTGTNITS="HDR Inverse Tone Mapping Target Nits"
DESC_GSHDRITMTGTNITS="set the target luninance of the inverse tone mapping process - Max is 10000 nits"
GUI_GSRT="Use Realtime Scheduling"
DESC_GSRT="enable GameScope realtime scheduling"
GUI_MODTOOLINVALIDUSAGE="It looks like you might be trying to launch 'XXX' using a desktop menu entry. This is not correct, please launch 'XXX' using the relevant start command from the command line, or through the SteamTinkerLaunch UI."
GUI_SDLUSEWAYLAND="SDL Wayland video driver"
DESC_SDLUSEWAYLAND="enables native Wayland support for SDL games that support it with SDL_VIDEODRIVER=wayland"
GUI_SGATITLE="Set Artwork for Game 'XXX (YYY)'"
Expand All @@ -1142,4 +1143,4 @@ DESC_SGABOXART="Box Art to be displayed in library / collections - Recommended r
GUI_SGATENFOOT="Tenfoot (Recently Played banner)"
DESC_SGATENFOOT="Banner that appears in library overview when a game is the most recently played - Recommended resolution of 600x350"
GUI_SGASETACTION="Artwork Set Method"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
3 changes: 2 additions & 1 deletion lang/french.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ GUI_GSHDRITMTGTNITS="HDR Inverse Tone Mapping Target Nits"
DESC_GSHDRITMTGTNITS="set the target luninance of the inverse tone mapping process - Max is 10000 nits"
GUI_GSRT="Use Realtime Scheduling"
DESC_GSRT="enable GameScope realtime scheduling"
GUI_MODTOOLINVALIDUSAGE="It looks like you might be trying to launch 'XXX' using a desktop menu entry. This is not correct, please launch 'XXX' using the relevant start command from the command line, or through the SteamTinkerLaunch UI."
GUI_SDLUSEWAYLAND="SDL Wayland video driver"
DESC_SDLUSEWAYLAND="enables native Wayland support for SDL games that support it with SDL_VIDEODRIVER=wayland"
GUI_SGATITLE="Set Artwork for Game 'XXX (YYY)'"
Expand All @@ -1142,4 +1143,4 @@ DESC_SGABOXART="Box Art to be displayed in library / collections - Recommended r
GUI_SGATENFOOT="Tenfoot (Recently Played banner)"
DESC_SGATENFOOT="Banner that appears in library overview when a game is the most recently played - Recommended resolution of 600x350"
GUI_SGASETACTION="Artwork Set Method"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
3 changes: 2 additions & 1 deletion lang/german.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ GUI_GSHDRITMTGTNITS="HDR Inverse Tone Mapping Target Nits"
DESC_GSHDRITMTGTNITS="set the target luninance of the inverse tone mapping process - Max is 10000 nits"
GUI_GSRT="Use Realtime Scheduling"
DESC_GSRT="enable GameScope realtime scheduling"
GUI_MODTOOLINVALIDUSAGE="It looks like you might be trying to launch 'XXX' using a desktop menu entry. This is not correct, please launch 'XXX' using the relevant start command from the command line, or through the SteamTinkerLaunch UI."
GUI_SDLUSEWAYLAND="SDL Wayland video driver"
DESC_SDLUSEWAYLAND="enables native Wayland support for SDL games that support it with SDL_VIDEODRIVER=wayland"
GUI_SGATITLE="Set Artwork for Game 'XXX (YYY)'"
Expand All @@ -1144,4 +1145,4 @@ DESC_SGABOXART="Box Art to be displayed in library / collections - Recommended r
GUI_SGATENFOOT="Tenfoot (Recently Played banner)"
DESC_SGATENFOOT="Banner that appears in library overview when a game is the most recently played - Recommended resolution of 600x350"
GUI_SGASETACTION="Artwork Set Method"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
3 changes: 2 additions & 1 deletion lang/italian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ GUI_GSHDRITMTGTNITS="HDR Inverse Tone Mapping Target Nits"
DESC_GSHDRITMTGTNITS="set the target luninance of the inverse tone mapping process - Max is 10000 nits"
GUI_GSRT="Use Realtime Scheduling"
DESC_GSRT="enable GameScope realtime scheduling"
GUI_MODTOOLINVALIDUSAGE="It looks like you might be trying to launch 'XXX' using a desktop menu entry. This is not correct, please launch 'XXX' using the relevant start command from the command line, or through the SteamTinkerLaunch UI."
GUI_SDLUSEWAYLAND="SDL Wayland video driver"
DESC_SDLUSEWAYLAND="enables native Wayland support for SDL games that support it with SDL_VIDEODRIVER=wayland"
GUI_SGATITLE="Set Artwork for Game 'XXX (YYY)'"
Expand All @@ -1142,4 +1143,4 @@ DESC_SGABOXART="Box Art to be displayed in library / collections - Recommended r
GUI_SGATENFOOT="Tenfoot (Recently Played banner)"
DESC_SGATENFOOT="Banner that appears in library overview when a game is the most recently played - Recommended resolution of 600x350"
GUI_SGASETACTION="Artwork Set Method"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
3 changes: 2 additions & 1 deletion lang/polish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ GUI_GSHDRITMTGTNITS="HDR Inverse Tone Mapping Target Nits"
DESC_GSHDRITMTGTNITS="set the target luninance of the inverse tone mapping process - Max is 10000 nits"
GUI_GSRT="Use Realtime Scheduling"
DESC_GSRT="enable GameScope realtime scheduling"
GUI_MODTOOLINVALIDUSAGE="It looks like you might be trying to launch 'XXX' using a desktop menu entry. This is not correct, please launch 'XXX' using the relevant start command from the command line, or through the SteamTinkerLaunch UI."
GUI_SDLUSEWAYLAND="SDL Wayland video driver"
DESC_SDLUSEWAYLAND="enables native Wayland support for SDL games that support it with SDL_VIDEODRIVER=wayland"
GUI_SGATITLE="Set Artwork for Game 'XXX (YYY)'"
Expand All @@ -1142,4 +1143,4 @@ DESC_SGABOXART="Box Art to be displayed in library / collections - Recommended r
GUI_SGATENFOOT="Tenfoot (Recently Played banner)"
DESC_SGATENFOOT="Banner that appears in library overview when a game is the most recently played - Recommended resolution of 600x350"
GUI_SGASETACTION="Artwork Set Method"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
3 changes: 2 additions & 1 deletion lang/russian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ GUI_GSHDRITMTGTNITS="HDR Inverse Tone Mapping Target Nits"
DESC_GSHDRITMTGTNITS="set the target luninance of the inverse tone mapping process - Max is 10000 nits"
GUI_GSRT="Use Realtime Scheduling"
DESC_GSRT="enable GameScope realtime scheduling"
GUI_MODTOOLINVALIDUSAGE="It looks like you might be trying to launch 'XXX' using a desktop menu entry. This is not correct, please launch 'XXX' using the relevant start command from the command line, or through the SteamTinkerLaunch UI."
GUI_SDLUSEWAYLAND="SDL Wayland video driver"
DESC_SDLUSEWAYLAND="enables native Wayland support for SDL games that support it with SDL_VIDEODRIVER=wayland"
GUI_SGATITLE="Set Artwork for Game 'XXX (YYY)'"
Expand All @@ -1142,4 +1143,4 @@ DESC_SGABOXART="Box Art to be displayed in library / collections - Recommended r
GUI_SGATENFOOT="Tenfoot (Recently Played banner)"
DESC_SGATENFOOT="Banner that appears in library overview when a game is the most recently played - Recommended resolution of 600x350"
GUI_SGASETACTION="Artwork Set Method"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
DESC_SGASETACTION="Specifies how to set the artwork, either by copying the source files, symlinking them, or moving them - If unsure, leave at default 'copy'"
71 changes: 58 additions & 13 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v12.12.20230307-1"
PROGVERS="v12.12.20230307-2"
PROGCMD="${0##*/}"
SHOSTL="stl"
GHURL="https://github.com"
Expand Down Expand Up @@ -13915,14 +13915,17 @@ function createHMMDesktopFile {
{
echo "[Desktop Entry]"
echo "Type=Application"
echo "Categories=Game;"
echo "Categories=Utilities;"
echo "Name=${HMM} ($PROGNAME) - GameBanana Handler"
echo "Comment=Link Handler - For internal use only"
echo "Icon=$STLICON"
echo "MimeType=$HMMGAMEMIMES"
echo "Terminal=false"
echo "X-KeepTerminal=false"
echo "Path=$HMMDLDIR"
echo "Exec=$(realpath "$0") ${HMM,,} u %u" # "hmm start" takes dl channel as argument, next arg is the URL
echo "NoDisplay=true"
echo "NoDisplay=false"
echo "Hidden=false"
} >> "$HMMDFDLPA"

# Associate GameBanana Mimes with DL desktop file
Expand Down Expand Up @@ -14016,20 +14019,23 @@ function setVortexDLMime {

VD="$VTX-${PROGNAME,,}-dl.desktop"
FVD="$HOME/.local/share/applications/$VD"

if [ ! -f "$FVD" ]; then
writelog "INFO" "${FUNCNAME[0]} - Creating new desktop file $FVD"
{
echo "[Desktop Entry]"
echo "Type=Application"
echo "Categories=Game;"
echo "Categories=Utilities;"
echo "Name=${VTX^} ($PROGNAME - ${PROGNAME,,})"
echo "Comment=Link Handler - For internal use only"
echo "Icon=$STLICON"
echo "MimeType=x-scheme-handler/nxm;x-scheme-handler/nxm-protocol"
echo "Terminal=false"
echo "X-KeepTerminal=false"
echo "Path=$(dirname "$VORTEXEXE")"
echo "Exec=$(realpath "$0") $VTX u %u"
echo "NoDisplay=true"
echo "NoDisplay=false"
echo "Hidden=false"
} >> "$FVD"

MO2D="$MO-${PROGNAME,,}-dl.desktop"
Expand Down Expand Up @@ -15240,6 +15246,11 @@ function vtxWinecfg {

#### VORTEX STOP ####

function warnInvalidModToolLaunch {
MODTOOLNAME="$1"
"$YAD" --title="SteamTinkerLaunch - $MODTOOLNAME Invalid Usage" --text="$( strFix "$GUI_MODTOOLINVALIDUSAGE" "$MODTOOLNAME")" --button="OK"
}

#### MO2 MOD ORGANIZER START: ####

function getLatestMO2Ver {
Expand Down Expand Up @@ -15762,14 +15773,17 @@ function setMO2DLMime {
{
echo "[Desktop Entry]"
echo "Type=Application"
echo "Categories=Game;"
echo "Categories=Utilities;"
echo "Name=$MO ($PROGNAME - ${PROGNAME,,})"
echo "Comment=Link Handler - For internal use only"
echo "Icon=$STLICON"
echo "MimeType=x-scheme-handler/nxm;x-scheme-handler/nxm-protocol"
echo "Terminal=false"
echo "X-KeepTerminal=false"
echo "Path=$(dirname "$MO2EXE")"
echo "Exec=$(realpath "$0") mo2 u %u"
echo "NoDisplay=true"
echo "NoDisplay=false"
echo "Hidden=false"
} >> "$FMO2D"

VD="$VTX-${PROGNAME,,}-dl.desktop"
Expand Down Expand Up @@ -19929,7 +19943,8 @@ function howto {
echo " desktopfile|df (Re-)create .desktop files for HedgeModManager"
echo " list-supported List games supported by HedgeModManager"
echo " list-installed List installed games with HedgeModManager support"
echo " list-owned List owned games on Steam with HedgeModManager support"
echo " list-owned List owned games on Steam with HedgeModManager support"
echo " resetmime (Re)set MimeType and application menu entries"
echo " uninstall Remove HedgeModManager downloads folder, desktop files and Wineprefix"
echo " Note that this will not remove your mods or installed Winetricks"
echo " opengridfolder|ogf Open the Steam Grid folder where custom game artwork is stored using xdg-open"
Expand Down Expand Up @@ -19973,6 +19988,7 @@ function howto {
echo " list-installed|li list installed games supported by MO2"
echo " create-instance|ci <id> create MO2 instance for <id>"
echo " url|u <url> open nxm url with MO2"
echo " resetmime (Re)set MimeType and application menu entries"
echo " winecfg Run Winecfg with MO2 Wine in MO2 prefix"
echo " play <gameid> Start game with id <gameid> directly"
echo " proton|p <title> <X> Start and/or create <title> with proton"
Expand Down Expand Up @@ -20029,8 +20045,9 @@ function howto {
echo " getset Show config of installed ${VTX^}"
echo " reset Reset all autodetected settings in ${VTX^}"
echo " stage <path> Add ${VTX^} stage via dialog"
echo " or directly the one given in <path>"
echo " resetmime (Re)set MimeType and application menu entries"
echo " winecfg Run Winecfg with ${VTX^} Wine in ${VTX^} prefix"
echo " or directly the one given in <path>"
echo " vr <windowname> <SteamAppID> <s> Start SBS-VR mode for <windowname>"
echo " and game <SteamAppID>"
echo " 's'ave windowname for the game"
Expand Down Expand Up @@ -20254,9 +20271,19 @@ function commandline {
manageMO2GInstance "$3"
fi
elif [ "$2" == "url" ] || [ "$2" == "u" ]; then
dlMod2nexurl "$3"
if [ -z "$3" ]; then
writelog "ERROR" "${FUNCNAME[0]} - No URL was passed for ('$3') -- Maybe this is being incorrectly launched from the XDG menu?"
warnInvalidModToolLaunch "ModOrganizer 2"
else
writelog "INFO" "${FUNCNAME[0]} - URL passed is '$3'"
dlMod2nexurl "$3"
fi
elif [ "$2" == "winecfg" ]; then
mo2Winecfg
elif [ "$2" == "resetmime" ]; then
writelog "INFO" "${FUNCMAME[0]} - (Re)setting MO2 .desktop file entries and MimeType associations"
echo "(Re)setting MO2 .desktop file entries and MimeType associations"
setMO2DLMime
else
writelog "INFO" "${FUNCNAME[0]} - arg2 '$2' is no valid command"
howto
Expand Down Expand Up @@ -20294,7 +20321,16 @@ function commandline {
elif [ "$2" == "uninstall" ]; then
uninstallHMM
elif [ "$2" == "url" ] || [ "$2" == "u" ]; then
dlHedgeMod "$3"
if [ -z "$3" ]; then
writelog "ERROR" "${FUNCNAME[0]} - No URL was passed for ('$3') -- Maybe this is being incorrectly launched from the XDG menu?"
warnInvalidModToolLaunch "Hedge Mod Manager"
else
dlHedgeMod "$3"
fi
elif [ "$2" == "resetmime" ]; then
writelog "INFO" "${FUNCMAME[0]} - (Re)setting HMM .desktop file entries and MimeType associations"
echo "(Re)setting HMM .desktop file entries and MimeType associations"
createHMMDesktopFile
else
echo "Need to input a valid arg2 '$2' to run a HedgeModManager command"
howto
Expand Down Expand Up @@ -20520,7 +20556,12 @@ function commandline {
elif [ "$2" == "start" ]; then
startVortex "noask" "$3"
elif [ "$2" == "url" ] || [ "$2" == "u" ]; then
startVortex "noask" "url" "$3"
if [ -z "$3" ]; then
writelog "ERROR" "${FUNCNAME[0]} - No URL was passed for ('$3') -- Maybe this is being incorrectly launched from the XDG menu?"
warnInvalidModToolLaunch "Vortex"
else
startVortex "noask" "url" "$3"
fi
elif [ "$2" == "getset" ]; then
startVortex "noask" "$2"
elif [ "$2" == "gui" ]; then
Expand Down Expand Up @@ -20573,6 +20614,10 @@ function commandline {
startVortex "activate" "$3"
elif [ "$2" == "winecfg" ]; then
vtxWinecfg
elif [ "$2" == "resetmime" ]; then
writelog "INFO" "${FUNCMAME[0]} - (Re)setting ${VTX^} .desktop file entries and MimeType associations"
echo "(Re)setting ${VTX^} .desktop file entries and MimeType associations"
setVortexDLMime
else
writelog "INFO" "${FUNCNAME[0]} - arg2 '$2' is no valid command"
howto
Expand Down