diff options
author | 諏訪子 <suwako@076.moe> | 2024-06-20 02:01:12 +0900 |
---|---|---|
committer | 諏訪子 <suwako@076.moe> | 2024-06-20 02:01:12 +0900 |
commit | 3cacd79655309275c820e639136c27604edd2451 (patch) | |
tree | ad19d3a1770a8ae20d81937979d3de3993b34236 | |
parent | a7fa8e216b14b93670369d1867a5c37f42407e90 (diff) |
クソったれーーーーーい!!
-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 " |