From d58b4c3d96046bd727f7c370bc3d6f296a3c2b53 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 2 Feb 2020 20:36:20 -0500 Subject: [PATCH] cmd: Add more info to --version. Now that modeline are supported, they will affect the content of version. This commits only adds the new information. `--version` has to be the last command line argument and the modeline isn't parsed yet. Another commit will make sure --version parses the modeline and finishes to process the command line arguments in case it isn't last. Please note that luarocks also affects data points such as the LGI version. It should be smarter and check if `rc.lua` has `require("luarocks")`. This commit does *not* do it. --- common/version.c | 25 +++++++++++++++++++------ globalconf.h | 4 ++++ options.c | 2 ++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/common/version.c b/common/version.c index c32fa3cd1..0fc481aa7 100644 --- a/common/version.c +++ b/common/version.c @@ -21,6 +21,7 @@ #include "config.h" #include "common/version.h" +#include "globalconf.h" #include "awesome-version-internal.h" #include @@ -67,16 +68,28 @@ eprint_version(void) printf("awesome %s (%s)\n" " • Compiled against %s (running with %s)\n" + " • API level: %d\n" " • D-Bus support: %s\n" " • xcb-errors support: %s\n" " • execinfo support: %s\n" " • xcb-randr version: %d.%d\n" - " • LGI version: %s\n", - AWESOME_VERSION, AWESOME_RELEASE, - LUA_RELEASE, lua_tostring(L, -2), - has_dbus, has_xcb_errors, has_execinfo, - XCB_RANDR_MAJOR_VERSION, XCB_RANDR_MINOR_VERSION, - lua_tostring(L, -1)); + " • LGI version: %s\n" + " • Transparency enabled: %s\n" + " • Custom search paths: %s\n", + /* version */ AWESOME_VERSION, + /* release */ AWESOME_RELEASE, + /* Lua linked */ LUA_RELEASE, + /* Lua runtime */ lua_tostring(L, -2), + /* API Level */ globalconf.api_level, + /* DBus */ has_dbus, + /* XCB Error */ has_xcb_errors, + /* Execinfo */ has_execinfo, + /* XRandR major */ XCB_RANDR_MAJOR_VERSION, + /* XRandR minor */ XCB_RANDR_MINOR_VERSION, + /* LGI version */ lua_tostring(L, -1), + /* ARGB support */ globalconf.had_overriden_depth ? "no" : "yes", + /* Search path */ globalconf.have_searchpaths ? "yes" : "no" + ); lua_close(L); exit(EXIT_SUCCESS); diff --git a/globalconf.h b/globalconf.h index 990700d05..970849bf5 100644 --- a/globalconf.h +++ b/globalconf.h @@ -126,6 +126,10 @@ typedef struct bool have_xkb; /** Check for XFixes extension */ bool have_xfixes; + /** Custom searchpaths are present, the runtime is tinted */ + bool have_searchpaths; + /** When --no-argb is used in the modeline or command line */ + bool had_overriden_depth; uint8_t event_base_shape; uint8_t event_base_xkb; uint8_t event_base_randr; diff --git a/options.c b/options.c index dc9b760da..ed2a905b9 100644 --- a/options.c +++ b/options.c @@ -428,9 +428,11 @@ options_check_args(int argc, char **argv, int *init_flags, string_array_t *paths break; case 's': + globalconf.have_searchpaths = true; string_array_append(paths, a_strdup(optarg)); break; case 'a': + globalconf.had_overriden_depth = true; (*init_flags) &= ~INIT_FLAG_ARGB; break; case 'r':