From 9b4695623a187965cff350df092740fe2670ad57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=88=E7=9F=A2=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Mon, 15 Jul 2024 06:15:13 +0000 Subject: [PATCH] =?UTF-8?q?Haiku:=20=E8=A7=A3=E5=83=8F=E5=BA=A6=E3=81=AE?= =?UTF-8?q?=E6=83=85=E5=A0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/resolution.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/resolution.c b/src/resolution.c index 5e6e6da..eaf6c94 100644 --- a/src/resolution.c +++ b/src/resolution.c @@ -7,6 +7,10 @@ #include const char *display_resolution() { +#if defined(__HAIKU__) + return run_command_s("screenmode | sed 's/Resolution: //' | sed 's/,.*$//' | " + "sed 's/ /x/'"); +#else const char *display = run_command_s("echo $DISPLAY"); if (display == NULL || strlen(display) == 0) return NULL; else free((void *)display); @@ -28,4 +32,5 @@ const char *display_resolution() { "connected.*[0-9]+x[0-9]+\\+/ && $2 {printf $2 " "\", \"}' | sed 's/primary //' | " "sed 's/,\\([^,]*\\)$/\\1/'"); +#endif }