From 8dd26ace232f7d90480bd3cdb82e703fb918af6e Mon Sep 17 00:00:00 2001
From: Malte Laurin Matthey <malte.matthey@student.kit.edu>
Date: Sat, 23 Nov 2024 16:39:15 +0100
Subject: [PATCH] add run executable for Windows

---
 run.ps1 | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 run.ps1

diff --git a/run.ps1 b/run.ps1
new file mode 100644
index 0000000..d023913
--- /dev/null
+++ b/run.ps1
@@ -0,0 +1,19 @@
+# Navigate to the .devcontainer directory
+cd "$(Join-Path $PSScriptRoot '.devcontainer')"
+
+# Set the DISPLAY environment variable to the host's address
+$env:DISPLAY="host.docker.internal:0.0"
+
+# Check if NVIDIA GPU is present
+if (Get-WmiObject Win32_VideoController | Where-Object { $_.Name -like "*NVIDIA*" }) {
+    # docker run -it `
+    #     --gpus all `
+    #     --env-file .env \
+    #     --env="DISPLAY=$env:DISPLAY" `
+    #     container-ros-noetic-moveit-panda /bin/bash
+    echo "DISPLAY1=$env:DISPLAY"
+
+} else {
+    docker run -it ` --env="DISPLAY=$env:DISPLAY" ` --env-file .env container-ros-noetic-moveit-panda /bin/bash
+    echo "DISPLAY=$env:DISPLAY"
+}
\ No newline at end of file
-- 
GitLab