summaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-07-13 10:15:03 +0200
committeraura <nw@moneybot.cc>2026-07-13 10:15:03 +0200
commit57d172df4db1451ba3caeeb0ca485d0845a61912 (patch)
treead0be7c8bec79a1eb58b25f2a631bc4b6809e7fd /install.sh
push source
Diffstat (limited to 'install.sh')
-rw-r--r--install.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/install.sh b/install.sh
new file mode 100644
index 0000000..ef87134
--- /dev/null
+++ b/install.sh
@@ -0,0 +1,53 @@
+#!/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."