make i3bar use libi3’s root_atom_contents()
This removes code duplication, which will be useful for a subsequent commit. Furthermore, we now don’t open X11 connections unnecessarily in some corner cases.
This commit is contained in:
@ -84,11 +84,14 @@ void errorlog(char *fmt, ...);
|
||||
* Try to get the contents of the given atom (for example I3_SOCKET_PATH) from
|
||||
* the X11 root window and return NULL if it doesn’t work.
|
||||
*
|
||||
* If the provided XCB connection is NULL, a new connection will be
|
||||
* established.
|
||||
*
|
||||
* The memory for the contents is dynamically allocated and has to be
|
||||
* free()d by the caller.
|
||||
*
|
||||
*/
|
||||
char *root_atom_contents(const char *atomname);
|
||||
char *root_atom_contents(const char *atomname, xcb_connection_t *provided_conn, int screen);
|
||||
|
||||
/**
|
||||
* Safe-wrapper around malloc which exits if malloc returns NULL (meaning that
|
||||
|
Reference in New Issue
Block a user