Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in function, variable names and in documentation #3887

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/modules/hyprland/windowcreationpayload.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class WindowCreationPayload {
std::string getWorkspaceName() const { return m_workspaceName; }
WindowAddress getAddress() const { return m_windowAddress; }

void moveToWorksace(std::string& new_workspace_name);
void moveToWorkspace(std::string& new_workspace_name);

private:
void clearAddr();
Expand Down
4 changes: 2 additions & 2 deletions include/modules/hyprland/workspace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ class Workspace {
void setName(std::string const& value) { m_name = value; };
void setOutput(std::string const& value) { m_output = value; };
bool containsWindow(WindowAddress const& addr) const { return m_windowMap.contains(addr); }
void insertWindow(WindowCreationPayload create_window_paylod);
void insertWindow(WindowCreationPayload create_window_payload);
std::string removeWindow(WindowAddress const& addr);
void initializeWindowMap(const Json::Value& clients_data);

bool onWindowOpened(WindowCreationPayload const& create_window_paylod);
bool onWindowOpened(WindowCreationPayload const& create_window_payload);
std::optional<std::string> closeWindow(WindowAddress const& addr);

void update(const std::string& format, const std::string& icon);
Expand Down
2 changes: 1 addition & 1 deletion include/modules/hyprland/workspaces.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Workspaces : public AModule, public EventHandler {

// Map for windows stored in workspaces not present in the current bar.
// This happens when the user has multiple monitors (hence, multiple bars)
// and doesn't share windows accross bars (a.k.a `all-outputs` = false)
// and doesn't share windows across bars (a.k.a `all-outputs` = false)
std::map<WindowAddress, std::string> m_orphanWindowMap;

enum class SortMethod { ID, NAME, NUMBER, DEFAULT };
Expand Down
4 changes: 2 additions & 2 deletions include/modules/sway/language.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Language : public ALabel, public sigc::trackable {
auto update() -> void override;

private:
enum class DispayedShortFlag { None = 0, ShortName = 1, ShortDescription = 1 << 1 };
enum class DisplayedShortFlag { None = 0, ShortName = 1, ShortDescription = 1 << 1 };

struct Layout {
std::string full_name;
Expand Down Expand Up @@ -58,7 +58,7 @@ class Language : public ALabel, public sigc::trackable {
std::map<std::string, Layout> layouts_map_;
bool hide_single_;
bool is_variant_displayed;
std::byte displayed_short_flag = static_cast<std::byte>(DispayedShortFlag::None);
std::byte displayed_short_flag = static_cast<std::byte>(DisplayedShortFlag::None);

util::JsonParser parser_;
std::mutex mutex_;
Expand Down
2 changes: 1 addition & 1 deletion include/modules/sway/workspaces.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Workspaces : public AModule, public sigc::trackable {
std::vector<std::string> high_priority_named_;
std::vector<std::string> workspaces_order_;
Gtk::Box box_;
std::string m_formatWindowSeperator;
std::string m_formatWindowSeparator;
util::RegexCollection m_windowRewriteRules;
util::JsonParser parser_;
std::unordered_map<std::string, Gtk::Button> buttons_;
Expand Down
2 changes: 1 addition & 1 deletion include/util/prepare_for_sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

namespace waybar::util {

// Get a signal emited with value true when entering sleep, and false when exiting
// Get a signal emitted with value true when entering sleep, and false when exiting
SafeSignal<bool>& prepare_for_sleep();
} // namespace waybar::util
2 changes: 1 addition & 1 deletion man/waybar-menu.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ waybar - menu property
# OVERVIEW


Some modules support a 'menu', which allows to have a popup menu whan a defined
Some modules support a 'menu', which allows to have a popup menu when a defined
click is done over the module.

# PROPERTIES
Expand Down
2 changes: 1 addition & 1 deletion man/waybar.5.scd.in
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The visual display elements for waybar use a CSS stylesheet, see *waybar-styles(
*no-center* ++
typeof: bool ++
default: false ++
Option to disable the center modules fully usefull together with expand-\*.
Option to disable the center modules fully useful together with expand-\*.

*spacing* ++
typeof: integer ++
Expand Down
4 changes: 2 additions & 2 deletions src/AModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ auto AModule::update() -> void {
}
}
// Get mapping between event name and module action name
// Then call overrided doAction in order to call appropriate module action
// Then call overridden doAction in order to call appropriate module action
auto AModule::doAction(const std::string& name) -> void {
if (!name.empty()) {
const std::map<std::string, std::string>::const_iterator& recA{eventActionMap_.find(name)};
// Call overrided action if derrived class has implemented it
// Call overridden action if derived class has implemented it
if (recA != eventActionMap_.cend() && name != recA->second) this->doAction(recA->second);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/hyprland/submap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Submap::Submap(const std::string& id, const Bar& bar, const Json::Value& config)
ALabel::update();

// Displays widget immediately if always_on_ assuming default submap
// Needs an actual way to retrive current submap on startup
// Needs an actual way to retrieve current submap on startup
if (always_on_) {
submap_ = default_submap_;
label_.get_style_context()->add_class(submap_);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/hyprland/windowcreationpayload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ bool WindowCreationPayload::isEmpty(Workspaces &workspace_manager) {

int WindowCreationPayload::incrementTimeSpentUncreated() { return m_timeSpentUncreated++; }

void WindowCreationPayload::moveToWorksace(std::string &new_workspace_name) {
void WindowCreationPayload::moveToWorkspace(std::string &new_workspace_name) {
m_workspaceName = new_workspace_name;
}

Expand Down
14 changes: 7 additions & 7 deletions src/modules/hyprland/workspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,19 @@ void Workspace::initializeWindowMap(const Json::Value &clients_data) {
}
}

void Workspace::insertWindow(WindowCreationPayload create_window_paylod) {
if (!create_window_paylod.isEmpty(m_workspaceManager)) {
auto repr = create_window_paylod.repr(m_workspaceManager);
void Workspace::insertWindow(WindowCreationPayload create_window_payload) {
if (!create_window_payload.isEmpty(m_workspaceManager)) {
auto repr = create_window_payload.repr(m_workspaceManager);

if (!repr.empty()) {
m_windowMap[create_window_paylod.getAddress()] = repr;
m_windowMap[create_window_payload.getAddress()] = repr;
}
}
};

bool Workspace::onWindowOpened(WindowCreationPayload const &create_window_paylod) {
if (create_window_paylod.getWorkspaceName() == name()) {
insertWindow(create_window_paylod);
bool Workspace::onWindowOpened(WindowCreationPayload const &create_window_payload) {
if (create_window_payload.getWorkspaceName() == name()) {
insertWindow(create_window_payload);
return true;
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ void Workspaces::onWindowMoved(std::string const &payload) {
// and exit
for (auto &window : m_windowsToCreate) {
if (window.getAddress() == windowAddress) {
window.moveToWorksace(workspaceName);
window.moveToWorkspace(workspaceName);
return;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/power_profiles_daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ PowerProfilesDaemon::PowerProfilesDaemon(const std::string& id, const Json::Valu
// method on the proxy to see whether or not something's responding
// on the other side.

// NOTE: the DBus adresses are under migration. They should be
// NOTE: the DBus addresses are under migration. They should be
// changed to org.freedesktop.UPower.PowerProfiles at some point.
//
// See
// https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/releases/0.20
//
// The old name is still announced for now. Let's rather use the old
// adresses for compatibility sake.
// addresses for compatibility sake.
//
// Revisit this in 2026, systems should be updated by then.

Expand Down
4 changes: 2 additions & 2 deletions src/modules/sway/language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Language::Language(const std::string& id, const Json::Value& config)
hide_single_ = config["hide-single-layout"].isBool() && config["hide-single-layout"].asBool();
is_variant_displayed = format_.find("{variant}") != std::string::npos;
if (format_.find("{}") != std::string::npos || format_.find("{short}") != std::string::npos) {
displayed_short_flag |= static_cast<std::byte>(DispayedShortFlag::ShortName);
displayed_short_flag |= static_cast<std::byte>(DisplayedShortFlag::ShortName);
}
if (format_.find("{shortDescription}") != std::string::npos) {
displayed_short_flag |= static_cast<std::byte>(DispayedShortFlag::ShortDescription);
displayed_short_flag |= static_cast<std::byte>(DisplayedShortFlag::ShortDescription);
}
if (config.isMember("tooltip-format")) {
tooltip_format_ = config["tooltip-format"].asString();
Expand Down
8 changes: 4 additions & 4 deletions src/modules/sway/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ Workspaces::Workspaces(const std::string &id, const Bar &bar, const Json::Value
box_.get_style_context()->add_class(MODULE_CLASS);
event_box_.add(box_);
if (config_["format-window-separator"].isString()) {
m_formatWindowSeperator = config_["format-window-separator"].asString();
m_formatWindowSeparator = config_["format-window-separator"].asString();
} else {
m_formatWindowSeperator = " ";
m_formatWindowSeparator = " ";
}
const Json::Value &windowRewrite = config["window-rewrite"];
if (windowRewrite.isObject()) {
Expand Down Expand Up @@ -271,7 +271,7 @@ void Workspaces::updateWindows(const Json::Value &node, std::string &windows) {
window = fmt::format(fmt::runtime(window), fmt::arg("name", title),
fmt::arg("class", windowClass));
windows.append(window);
windows.append(m_formatWindowSeperator);
windows.append(m_formatWindowSeparator);
}
}
for (const Json::Value &child : node["nodes"]) {
Expand Down Expand Up @@ -340,7 +340,7 @@ auto Workspaces::update() -> void {
fmt::runtime(format), fmt::arg("icon", getIcon(output, *it)), fmt::arg("value", output),
fmt::arg("name", trimWorkspaceName(output)), fmt::arg("index", (*it)["num"].asString()),
fmt::arg("windows",
windows.substr(0, windows.length() - m_formatWindowSeperator.length())),
windows.substr(0, windows.length() - m_formatWindowSeparator.length())),
fmt::arg("output", (*it)["output"].asString()));
}
if (!config_["disable-markup"].asBool()) {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ waybar::modules::Temperature::Temperature(const std::string& id, const Json::Val
file_path_ = fmt::format("/sys/class/thermal/thermal_zone{}/temp", zone);
}

// check if file_path_ can be used to retrive the temperature
// check if file_path_ can be used to retrieve the temperature
std::ifstream temp(file_path_);
if (!temp.is_open()) {
throw std::runtime_error("Can't open " + file_path_);
Expand Down Expand Up @@ -148,4 +148,4 @@ bool waybar::modules::Temperature::isWarning(uint16_t temperature_c) {
bool waybar::modules::Temperature::isCritical(uint16_t temperature_c) {
return config_["critical-threshold"].isInt() &&
temperature_c >= config_["critical-threshold"].asInt();
}
}
Loading