HGL
firm-tan

Ludusavi Integration for Non-heroic games

I will use a script to detect the name but it will use folder name to determine the game name , which has to be matched in ludusavi. 1. Download ludusavi binary and copy to one of your $PATH 2. Create a wrapper script in one of your $PATH also keep in mind to make it executable 3. Here is the script content that worked for me.
1 Reply
firm-tan
firm-tanOP2mo ago
#!/usr/bin/env bash
# Description : Ludusavi Wrapper for Heroic Games Launcher (non-heroic games). This script assumes your game name from folder name.
# Usage : Be sure `$HOME/games/<GameFolderName>` <GameFolderName> will be used as game name. Make sure <GameFolderName> name is either aliased or actual name in ludusavi.
# Note : I wanted use exe name but I think folder name will be more consistent across different games including emulators.
# Logging : Logs are optional - uncomment to debug recognition issues


#########################################
# Game Path Detection
#########################################

# Define the games directory pattern
GAMES_DIR="$HOME/games"

# Initialize variables
game_path=""
game_name=""

# Find the game executable path in arguments
for arg in "$@"; do
case "$arg" in
"$GAMES_DIR"/*)
game_path="$arg"
break
;;
esac
done

# Extract game name if path found
if [ -n "$game_path" ]; then
game_dir=$(dirname "$game_path")
game_name=$(basename "$game_dir")
fi

#########################################
# Optional Logging
#########################################
# log_file="$HOME/games/.tools/ludusavi_wrapper.log"
# {
# # Timestamp and original arguments
# echo "----- $(date) -----"
# echo "Original arguments from Heroic:"
# printf " '%s'\n" "$@"

# # Extracted game information
# echo "Extracted game name: '$game_name'"
# printf "\n\n"
# } >> "$log_file"



#########################################
# Ludusavi Execution
#########################################
ludusavi --config "$HOME/.config/ludusavi" wrap \
--gui \
--name "${game_name}" \
-- "$@"
#!/usr/bin/env bash
# Description : Ludusavi Wrapper for Heroic Games Launcher (non-heroic games). This script assumes your game name from folder name.
# Usage : Be sure `$HOME/games/<GameFolderName>` <GameFolderName> will be used as game name. Make sure <GameFolderName> name is either aliased or actual name in ludusavi.
# Note : I wanted use exe name but I think folder name will be more consistent across different games including emulators.
# Logging : Logs are optional - uncomment to debug recognition issues


#########################################
# Game Path Detection
#########################################

# Define the games directory pattern
GAMES_DIR="$HOME/games"

# Initialize variables
game_path=""
game_name=""

# Find the game executable path in arguments
for arg in "$@"; do
case "$arg" in
"$GAMES_DIR"/*)
game_path="$arg"
break
;;
esac
done

# Extract game name if path found
if [ -n "$game_path" ]; then
game_dir=$(dirname "$game_path")
game_name=$(basename "$game_dir")
fi

#########################################
# Optional Logging
#########################################
# log_file="$HOME/games/.tools/ludusavi_wrapper.log"
# {
# # Timestamp and original arguments
# echo "----- $(date) -----"
# echo "Original arguments from Heroic:"
# printf " '%s'\n" "$@"

# # Extracted game information
# echo "Extracted game name: '$game_name'"
# printf "\n\n"
# } >> "$log_file"



#########################################
# Ludusavi Execution
#########################################
ludusavi --config "$HOME/.config/ludusavi" wrap \
--gui \
--name "${game_name}" \
-- "$@"
if game isn't recognised then uncomment logging. Log file location is in the script hope this help others

Did you find this page helpful?