summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author諏訪子 <suwako@076.moe>2024-06-20 05:11:10 +0900
committer諏訪子 <suwako@076.moe>2024-06-20 05:11:10 +0900
commita30c3fda77d8aadfcc388cba4734efedfc79144a (patch)
treeb48c26ef78355d5b3b128838ce698911f5209516
parent14d2f644bb62c1e9e838688a193614809255c17e (diff)
dmesgが複数回同じGPUを出力可能性があるらしい
-rw-r--r--src/gpu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gpu.c b/src/gpu.c
index f2b641b..49cba81 100644
--- a/src/gpu.c
+++ b/src/gpu.c
@@ -9,10 +9,10 @@
const char *display_gpu() {
#if defined(__OpenBSD__)
return run_command_s("dmesg | grep -i graphics | sed 's/^.* \"//' | "
- "sed 's/\".*$//'");
+ "sed 's/\".*$//' | head -1");
#elif defined(__NetBSD__)
return run_command_s("dmesg | grep -i graphics | sed 's/^.*: //' | "
- "sed 's/ (.*$//'");
+ "sed 's/ (.*$//' | head -1");
#elif defined(__FreeBSD__) || defined(__DragonFly__)
return run_command_s("pciconf -lv | grep -B 4 -F \"VGA\" | "
"grep -F \"device\" | sed 's/^.* device//' | "