From f01c5fd8a969e033d31bf606835fe0d32dd5e447 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 00:45:27 +0900 Subject: =?UTF-8?q?xrandr=E3=81=8C=E3=81=AA=E3=81=91=E3=82=8C=E3=81=B0?= =?UTF-8?q?=EF=BC=88=E3=82=B5=E3=83=BC=E3=83=90=E3=82=84Gaylord=E7=AD=89?= =?UTF-8?q?=EF=BC=89=E3=80=81=E8=A7=A3=E5=83=8F=E5=BA=A6=E3=82=92=E3=82=B9?= =?UTF-8?q?=E3=82=AD=E3=83=83=E3=83=97=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/resolution.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/resolution.c b/src/resolution.c index f089fd2..635bab6 100644 --- a/src/resolution.c +++ b/src/resolution.c @@ -1,7 +1,17 @@ #include "resolution.h" #include "common.h" +#include +#include + const char *display_resolution() { + const char *isexist = run_command_s("which xrandr"); + if ( + isexist == NULL || + strlen(isexist) == 0 || + strncmp(isexist, "xrandr not found", strlen("xrandr not found")) + ) 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