polybar-dwm/include/modules
Mihir Lad 866c88c1d3 dwm: Reorganize module
Remove EVENT_SCROLL_{UP_DOWN} since it is not being used.

Change EVENT_PREFIX to include dash and event names to be just the name without
the prefix, for simplified parsing. Use check_send_cmd function to parse the
cmd, using the event name as the IPC command name, and the section after the
event name to be the argument. The format of a cmd would be "dwm-<event
name>-<arg>", so the cmd can easily be translated into an IPC command.

Call member functions for all dwmipc events for better organization and to avoid
cluttering the constructor. The dwmipc event functions are now just assigned to
a lambda that calls a member function.

Add update_tag_labels function for updating the tag labels based on their state
since this code is repetetive.

Add update_title_labels function since that code is also somewhat repetetive.

Move reconnect code to reconnect_dwm for better organization.

Use pointers to m_monitors array elements instead of holding onto indices, since
most of the time, a member of the Monitor element will need to be accessed.
These variables should always hold a valid address starting in the constructor,
so checks for nullptr should not be necessary. A monitor will always be active
and the bar will always be mapped onto a monitor.

Add some comments where needed.

Reorganize the constructor into a more logical format

Only subscribe to events if their labels are included in the default format.

Follow clang-tidy warnings and use trailing return types.

Move m_ipc->get_monitors to update_monitor_ref since in most cases where the
monitor references would need to be updated using geometry, m_ipc->get_monitors
would need to be called.
2020-12-19 19:43:05 -05:00
..
meta Add dwm module 2020-12-19 19:43:01 -05:00
alsa.hpp Incorporate reviews 2020-11-26 20:53:53 +01:00
backlight.hpp Incorporate reviews 2020-11-26 20:53:53 +01:00
battery.hpp feat: Warn state for cpu, memory, fs, battery modules (#2199) 2020-12-02 15:55:13 +01:00
bspwm.hpp Incorporate reviews 2020-11-26 20:53:53 +01:00
counter.hpp refactor: Move module type string into modules 2020-11-26 20:53:53 +01:00
cpu.hpp feat: Warn state for cpu, memory, fs, battery modules (#2199) 2020-12-02 15:55:13 +01:00
date.hpp Incorporate reviews 2020-11-26 20:53:53 +01:00
dwm.hpp dwm: Reorganize module 2020-12-19 19:43:05 -05:00
fs.hpp feat: Warn state for cpu, memory, fs, battery modules (#2199) 2020-12-02 15:55:13 +01:00
github.hpp refactor: Move module type string into modules 2020-11-26 20:53:53 +01:00
i3.hpp Incorporate reviews 2020-11-26 20:53:53 +01:00
ipc.hpp refactor: Move module type string into modules 2020-11-26 20:53:53 +01:00
memory.hpp feat: Warn state for cpu, memory, fs, battery modules (#2199) 2020-12-02 15:55:13 +01:00
menu.hpp Incorporate reviews 2020-11-26 20:53:53 +01:00
mpd.hpp Load rgba from config instead of strings. 2020-11-27 22:08:03 +01:00
network.hpp feat(network): Ability to change speed unit text (B/s) (#2068) 2020-11-29 14:15:27 +01:00
pulseaudio.hpp Incorporate reviews 2020-11-26 20:53:53 +01:00
script.hpp refactor: Move module type string into modules 2020-11-26 20:53:53 +01:00
systray.hpp Incorporate reviews 2020-11-26 20:53:53 +01:00
temperature.hpp feat: Warn state for cpu, memory, fs, battery modules (#2199) 2020-12-02 15:55:13 +01:00
text.hpp refactor: Move module type string into modules 2020-11-26 20:53:53 +01:00
unsupported.hpp Add dwm module to unsupported.hpp 2020-12-19 19:30:00 -05:00
xbacklight.hpp Incorporate reviews 2020-11-26 20:53:53 +01:00
xkeyboard.hpp Incorporate reviews 2020-11-26 20:53:53 +01:00
xwindow.hpp refactor: Move module type string into modules 2020-11-26 20:53:53 +01:00
xworkspaces.hpp fix(xworkspaces): Never swallow updates (#2275) 2020-12-05 23:28:48 +01:00