diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/resolution.c | 6 |
1 files 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 <stdlib.h> 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 " |