#!/bin/sh set -ex pipefail if [[ $UID == 0 ]]; then echo "cannot run as root" fi make if [ $? -ne 0 ]; then echo "make failed" exit 1 fi mkdir -p ~/.local/lib64/ if [ $? -ne 0 ]; then echo "mkdir -p ~/.local/lib64/ failed" exit 1 fi cp ./libfhvkov_layer.so ~/.local/lib64/ if [ $? -ne 0 ]; then echo "cp ./libfhvkov_layer.so ~/.local/lib64/ failed" exit 1 fi mkdir -p ~/.local/share/vulkan/implicit_layer.d/ if [ $? -ne 0 ]; then echo "mkdir -p ~/.local/share/vulkan/implicit_layer.d/ failed" exit 1 fi cat >> ~/.local/share/vulkan/implicit_layer.d/fhvkov_layer.json << EOF { "file_format_version": "1.0.0", "layer": { "name": "VK_LAYER_fhrpm_overlay", "type": "GLOBAL", "library_path": "$HOME/.local/lib64/libfhvkov_layer.so", "api_version": "1.3.0", "implementation_version": "1", "description": "forza horizon vulkan telemetry overlay", "enable_environment": { "FHVKOV": "1" }, "disable_environment": { "FHVKOV_DISABLE": "1" } } } EOF if [ $? -ne 0 ]; then echo "failed to install layer" exit 1 fi echo "done."