e707e0a5fa
Implement the configuration option within the bar config directive for custom workspace numbers with the directive `strip_workspace_numbers yes`. This directive strips the workspace name of the number prefix and delimiter. When the workspace name consists only of the number, it will default to show the number. For example: * "2:5" -> "5" * "4:$" -> "$" * "8" -> "8" This allows customization of i3bar for alternate ordering of workspaces which has a legitimate use for alternate keyboard layouts such as Dvorak. fixes #1131
45 lines
1.3 KiB
C
45 lines
1.3 KiB
C
/*
|
|
* vim:ts=4:sw=4:expandtab
|
|
*
|
|
* i3bar - an xcb-based status- and ws-bar for i3
|
|
* © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
|
|
*
|
|
* workspaces.c: Maintaining the workspace-lists
|
|
*
|
|
*/
|
|
#pragma once
|
|
|
|
#include <xcb/xproto.h>
|
|
|
|
#include "common.h"
|
|
|
|
typedef struct i3_ws i3_ws;
|
|
|
|
TAILQ_HEAD(ws_head, i3_ws);
|
|
|
|
/*
|
|
* Start parsing the received json-string
|
|
*
|
|
*/
|
|
void parse_workspaces_json(char *json);
|
|
|
|
/*
|
|
* free() all workspace data-structures
|
|
*
|
|
*/
|
|
void free_workspaces(void);
|
|
|
|
struct i3_ws {
|
|
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 */
|
|
int name_width; /* The rendered width of the name */
|
|
bool visible; /* If the ws is currently visible on an output */
|
|
bool focused; /* If the ws is currently focused */
|
|
bool urgent; /* If the urgent-hint of the ws is set */
|
|
rect rect; /* The rect of the ws (not used (yet)) */
|
|
struct i3_output *output; /* The current output of the ws */
|
|
|
|
TAILQ_ENTRY(i3_ws) tailq; /* Pointer for the TAILQ-Macro */
|
|
};
|