mirror of
https://github.com/polybar/polybar.git
synced 2026-03-01 05:19:54 +00:00
refactor(clang-tidy): Apply fixes
This commit is contained in:
@ -199,13 +199,15 @@ namespace modules {
|
||||
}
|
||||
|
||||
try {
|
||||
using namespace i3_util;
|
||||
|
||||
string scrolldir;
|
||||
const i3_util::connection_t conn{};
|
||||
const connection_t conn{};
|
||||
|
||||
if (cmd.compare(0, strlen(EVENT_CLICK), EVENT_CLICK) == 0) {
|
||||
const string workspace_num{cmd.substr(strlen(EVENT_CLICK))};
|
||||
|
||||
if (i3_util::focused_workspace(conn)->num != atoi(workspace_num.c_str())) {
|
||||
if (focused_workspace(conn)->num != atoi(workspace_num.c_str())) {
|
||||
m_log.info("%s: Sending workspace focus command to ipc handler", name());
|
||||
conn.send_command("workspace number " + workspace_num);
|
||||
}
|
||||
@ -217,12 +219,14 @@ namespace modules {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (scrolldir == "next" && (m_wrap || *i3_util::workspaces(conn, m_bar.monitor->name).back() != *i3_util::focused_workspace(conn))) {
|
||||
const string& mon_name{m_bar.monitor->name};
|
||||
|
||||
if (scrolldir == "next" && (m_wrap || *workspaces(conn, mon_name).back() != *focused_workspace(conn))) {
|
||||
m_log.info("%s: Sending workspace next command to ipc handler", name());
|
||||
i3_util::connection_t{}.send_command("workspace next_on_output");
|
||||
} else if (scrolldir == "prev" && (m_wrap || *i3_util::workspaces(conn, m_bar.monitor->name).front() != *i3_util::focused_workspace(conn))) {
|
||||
conn.send_command("workspace next_on_output");
|
||||
} else if (scrolldir == "prev" && (m_wrap || *workspaces(conn, mon_name).front() != *focused_workspace(conn))) {
|
||||
m_log.info("%s: Sending workspace prev command to ipc handler", name());
|
||||
i3_util::connection_t{}.send_command("workspace prev_on_output");
|
||||
conn.send_command("workspace prev_on_output");
|
||||
}
|
||||
} catch (const exception& err) {
|
||||
m_log.err("%s: %s", name(), err.what());
|
||||
|
||||
Reference in New Issue
Block a user