Rename settings and allow more flexible configuration by allowing the user to
enable click handlers for the tags and the layout label separately.
Add a scroll handler for the layout label so the user can scroll through the
available layouts. Enabling layout-scroll-wrap allows wrapping back to the
beginning/end of the array of available layouts.
next_layout and prev_layout take the address of a layout and returns the
next/previous layout in the m_layouts array if possible, wrapping if specified,
otherwise returns the same layout. This is used to for the layout scroll
handlers to cycle through layouts.
secondary-layout-symbol is the symbol of the layout to switch to when the layout
symbol is left-clicked. This symbol is used to look up the memory address of the
layout to set. The default is the monocle layout.
setlayoutsafe is the dwm command name for setting layouts. The argument is the
layout memory address. Left-clicking switches to the layout represented by
secondary-layout-symbol, and right-clicking switches to the previous layout
(specified by an argument of 0).
To keep track of the different layouts, the layouts are retrieved in the
constructor if the layout label is included and stored in m_layouts.
m_current_layout is updated with the address of the current layout.
m_default_layout is updated in the constructor to the first layout in the array
which is the default layout in dwm. m_secondary_layout is updated to the address
of the layout identified by secondary-layout-symbol.
The builder adds click handlers (if layout label is included) to the layout
symbol as described above. Left-clicking toggles between the secondary layout
and the default layout. Right-clicking toggles between the previous layout and
the current layout.
find_layout are a pair of functions for finding a layout by address or symbol
from the m_layouts array.
If pin-tags is set, there is no format defined for tags that are not occupied.
However defining a format for unoccupied tags makes the pin-tags setting
redundant since then the label can just be set to empty to not show unoccupied
tags.
Following the above reasoning, the pin tags setting is removed, and
state_t::NONE is renamed to state_t::EMPTY. This way if a user wants to display
empty tags, they can specify the format, otherwise they can simply set the label
to an empty string.
label-state will be the label used for each tag. label-layout will show the
current layout. label-title will show the current window title.
label-title allows each monitor to show its selected window's title on the bar.
The xwindow module only shows the currently focused window on all monitors.
pin-tags will show all tags whether or not they are selected.
label-separator is inserted between workspaces.
enable-click will allow the user to view tags and toggle the view on tags.