From 3cacd79655309275c820e639136c27604edd2451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Thu, 20 Jun 2024 02:01:12 +0900 Subject: =?UTF-8?q?=E3=82=AF=E3=82=BD=E3=81=A3=E3=81=9F=E3=82=8C=E3=83=BC?= =?UTF-8?q?=E3=83=BC=E3=83=BC=E3=83=BC=E3=83=BC=E3=81=84=EF=BC=81=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/resolution.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resolution.c b/src/resolution.c index 249d6c6..1438d48 100644 --- a/src/resolution.c +++ b/src/resolution.c @@ -7,6 +7,9 @@ #include const char *display_resolution() { + const char *display = run_command_s("echo $DISPLAY"); + if (display == NULL || strlen(display) == 0) return NULL; + const char *isexist = run_command_s("which xrandr"); if ( isexist == NULL || @@ -18,9 +21,6 @@ const char *display_resolution() { } free((void *)isexist); - const char *display = run_command_s("echo $DISPLAY"); - if (display == NULL || strlen(display) == 0) return NULL; - return run_command_s("xrandr --nograb --current | " "awk -F 'connected |\\\\+|\\\\(' '/ " "connected.*[0-9]+x[0-9]+\\+/ && $2 {printf $2 " -- cgit v1.2.3