Implement shmlog command
Add shmlog command that takes <size>|toggle|on|off. Separate logbuffer management into open_logbuffer() and close_logbuffer(). Make t/187-commands-parser.t expect 'shmlog'. Add update_shmlog_atom() to update the SHMLOG_PATH. Document the shmlog command in userguide.
This commit is contained in:
committed by
Michael Stapelberg
parent
684a77442e
commit
f9d93d75b3
13
src/x.c
13
src/x.c
@ -1063,6 +1063,16 @@ void x_set_name(Con *con, const char *name) {
|
||||
state->name = sstrdup(name);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up the I3_SHMLOG_PATH atom.
|
||||
*
|
||||
*/
|
||||
void update_shmlog_atom() {
|
||||
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root,
|
||||
A_I3_SHMLOG_PATH, A_UTF8_STRING, 8,
|
||||
strlen(shmlogname), shmlogname);
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets up i3 specific atoms (I3_SOCKET_PATH and I3_CONFIG_PATH)
|
||||
*
|
||||
@ -1075,8 +1085,7 @@ void x_set_i3_atoms(void) {
|
||||
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_PID, XCB_ATOM_CARDINAL, 32, 1, &pid);
|
||||
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_CONFIG_PATH, A_UTF8_STRING, 8,
|
||||
strlen(current_configpath), current_configpath);
|
||||
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, root, A_I3_SHMLOG_PATH, A_UTF8_STRING, 8,
|
||||
strlen(shmlogname), shmlogname);
|
||||
update_shmlog_atom();
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user