diff options
author | Iskustvo <iskustvo@yahoo.com> | 2020-01-07 02:32:18 +0100 |
---|---|---|
committer | Iskustvo <iskustvo@yahoo.com> | 2020-01-08 09:07:53 +0100 |
commit | 5835bbc3855c99252e2a94e9ae69df189279e20c (patch) | |
tree | b2b206a47e218d7a46a841525c26680a05b26540 /i3bar | |
parent | d341b91b0a79390aa7c5f1a8095d3d48ddfef9ad (diff) | |
download | i3-5835bbc3855c99252e2a94e9ae69df189279e20c.tar.gz i3-5835bbc3855c99252e2a94e9ae69df189279e20c.zip |
Added workspace ID in GET_WORKSPACES response.
Diffstat (limited to 'i3bar')
-rw-r--r-- | i3bar/include/workspaces.h | 1 | ||||
-rw-r--r-- | i3bar/src/workspaces.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/i3bar/include/workspaces.h b/i3bar/include/workspaces.h index e1f9e887..0ef5c0a9 100644 --- a/i3bar/include/workspaces.h +++ b/i3bar/include/workspaces.h @@ -30,6 +30,7 @@ void parse_workspaces_json(char *json); void free_workspaces(void); struct i3_ws { + uintptr_t id; /* Workspace ID - C pointer to a workspace container */ int num; /* The internal number of the ws */ char *canonical_name; /* The true name of the ws according to the ipc */ i3String *name; /* The name of the ws that is displayed on the bar */ diff --git a/i3bar/src/workspaces.c b/i3bar/src/workspaces.c index 7285d150..9a0b950e 100644 --- a/i3bar/src/workspaces.c +++ b/i3bar/src/workspaces.c @@ -61,6 +61,12 @@ static int workspaces_boolean_cb(void *params_, int val) { static int workspaces_integer_cb(void *params_, long long val) { struct workspaces_json_params *params = (struct workspaces_json_params *)params_; + if (!strcmp(params->cur_key, "id")) { + params->workspaces_walk->id = val; + FREE(params->cur_key); + return 1; + } + if (!strcmp(params->cur_key, "num")) { params->workspaces_walk->num = (int)val; FREE(params->cur_key); |