summaryrefslogtreecommitdiff
path: root/swaymsg
diff options
context:
space:
mode:
authorRolf Vidar Mazunki Hoksaas <[email protected]>2024-02-15 03:29:04 +0100
committerGitHub <[email protected]>2024-02-14 21:29:04 -0500
commit271af3d4748c7c0c4f45c3c250c33fb7b3399ed5 (patch)
treee24705656be81418cd2de3b6baa31e091d084bb0 /swaymsg
parentcf3ef50a3fb8bf6d8b63d84d15cfdf0ae72daedb (diff)
enhancement: update version printing format (#254)
* enhancement: update version printing format as mentioned in #253, version numbers can be confusing if you don't know or realize you're running SwayFX instead of standard sway. to fix this issue, I've updated the way we display versions, replacing "sway version X" to "swayfx version X", suffixed by the sway upstream version which swayfx is based upon. while not immediately displaying we come from swayfx in swaymsg/swaynag/swaybar, we do display we're based off a specific upstream sway version. note: this requires updating `meson.build` (currently `meson.build:181`) each time we rebase into a new sway version. Closes: Issue #253 Signed-off-by: Mazunki Hoksaas <[email protected]> * reduce linelength --------- Signed-off-by: Mazunki Hoksaas <[email protected]>
Diffstat (limited to 'swaymsg')
-rw-r--r--swaymsg/main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/swaymsg/main.c b/swaymsg/main.c
index c0b5809e..237a4a71 100644
--- a/swaymsg/main.c
+++ b/swaymsg/main.c
@@ -294,9 +294,12 @@ static void pretty_print_output(json_object *o) {
}
static void pretty_print_version(json_object *v) {
- json_object *ver;
- json_object_object_get_ex(v, "human_readable", &ver);
- printf("sway version %s\n", json_object_get_string(ver));
+ json_object *swayfx_ver;
+ json_object *sway_ver;
+ json_object_object_get_ex(v, "human_readable", &swayfx_ver);
+ json_object_object_get_ex(v, "sway_original_version", &sway_ver);
+ printf("swayfx version %s (based on sway %s)\n",
+ json_object_get_string(swayfx_ver), json_object_get_string(sway_ver));
}
static void pretty_print_config(json_object *c) {
@@ -470,7 +473,7 @@ int main(int argc, char **argv) {
cmdtype = strdup(optarg);
break;
case 'v':
- printf("swaymsg version " SWAY_VERSION "\n");
+ printf("swaymsg version " SWAY_VERSION " (based on sway " SWAY_ORIGINAL_VERSION ")\n");
exit(EXIT_SUCCESS);
break;
default: