37e3f273d1b8ed294c99c4860d02093af0ab2a43

Author
outfoxxed <outfoxxed@outfoxxed.me>
Committer
outfoxxed <outfoxxed@outfoxxed.me>
Date

Message

Add clang-format and editorconfig

Diff

This diff is truncated to protect this page.

  1diff --git a/.clang-format b/.clang-format
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..89917c253ccb755eef0c9e651fe28724f1305887
  4--- /dev/null
  5+++ b/.clang-format
  6@@ -0,0 +1,72 @@
  7+---
  8+AlignArrayOfStructures: None
  9+AlignAfterOpenBracket: BlockIndent
 10+AllowShortBlocksOnASingleLine: Always
 11+AllowShortCaseLabelsOnASingleLine: true
 12+AllowShortEnumsOnASingleLine: true
 13+AllowShortFunctionsOnASingleLine: All
 14+AllowShortIfStatementsOnASingleLine: AllIfsAndElse
 15+AllowShortLambdasOnASingleLine: All
 16+AllowShortLoopsOnASingleLine: true
 17+BinPackArguments: false
 18+BinPackParameters: false
 19+Cpp11BracedListStyle: true
 20+LambdaBodyIndentation: Signature
 21+UseCRLF: false
 22+UseTab: ForIndentation
 23+SpacesInSquareBrackets: false
 24+SpacesInParentheses: false
 25+SpacesInCStyleCastParentheses: false
 26+SpacesInAngles: Never
 27+SpaceInEmptyParentheses: false
 28+SpaceInEmptyBlock: false
 29+SpaceBeforeSquareBrackets: false
 30+SpaceBeforeRangeBasedForLoopColon: false
 31+SpaceAfterCStyleCast: true
 32+SpaceAfterLogicalNot: false
 33+SpaceAfterTemplateKeyword: true
 34+SpaceBeforeCaseColon: false
 35+SpaceBeforeCpp11BracedList: true
 36+SpaceBeforeCtorInitializerColon: false
 37+SpaceBeforeInheritanceColon: false
 38+SpaceBeforeParens: ControlStatementsExceptControlMacros
 39+SortIncludes: CaseInsensitive
 40+PointerAlignment: Left
 41+PackConstructorInitializers: CurrentLine
 42+LineEnding: LF
 43+InsertBraces: false
 44+BreakConstructorInitializers: AfterColon
 45+BreakBeforeBraces: Custom
 46+BreakInheritanceList: AfterColon
 47+AllowAllParametersOfDeclarationOnNextLine: false
 48+AllowAllArgumentsOnNextLine: false
 49+AlwaysBreakTemplateDeclarations: Yes
 50+BraceWrapping:
 51+  AfterClass: false
 52+  AfterFunction: false
 53+  AfterCaseLabel: false
 54+  AfterEnum: false
 55+  AfterNamespace: false
 56+  AfterStruct: false
 57+  AfterUnion: false
 58+  AfterExternBlock: false
 59+  BeforeCatch: false
 60+  BeforeElse: false
 61+  BeforeLambdaBody: false
 62+  BeforeWhile: false
 63+  IndentBraces: false
 64+  SplitEmptyFunction: true
 65+  SplitEmptyRecord: false
 66+  SplitEmptyNamespace: false
 67+  AfterControlStatement: MultiLine
 68+BreakBeforeBinaryOperators: All
 69+BreakBeforeTernaryOperators: true
 70+AlignOperands: AlignAfterOperator
 71+InsertTrailingCommas: Wrapped
 72+MaxEmptyLinesToKeep: 1
 73+ExperimentalAutoDetectBinPacking: false
 74+ColumnLimit: 100
 75+IndentWidth: 2
 76+TabWidth: 2
 77+AllowAllConstructorInitializersOnNextLine: false
 78+ConstructorInitializerAllOnOneLineOrOnePerLine: true
 79diff --git a/.editorconfig b/.editorconfig
 80new file mode 100644
 81index 0000000000000000000000000000000000000000..0b09ad29a8dacead5f79b6f3efec2bf8ce590c30
 82--- /dev/null
 83+++ b/.editorconfig
 84@@ -0,0 +1,11 @@
 85+root = true
 86+
 87+[*]
 88+charset = utf-8
 89+end_of_line = lf
 90+insert_final_newline = true
 91+indent_style = tab
 92+
 93+[*.nix]
 94+indent_style = space
 95+indent_size = 2
 96diff --git a/flake.nix b/flake.nix
 97index f0b4a932c5ac21d1bde8a3257a5a4e74d38e73af..6cfab11ab4c45e9bf6f8dabb678f185fbea883c6 100644
 98--- a/flake.nix
 99+++ b/flake.nix
100@@ -42,7 +42,7 @@
101         name = "hy3";
102 
103         nativeBuildInputs = with pkgs; [
104-          clang-tools_15
105+          clang-tools_16
106           bear
107         ];
108 
109diff --git a/src/Hy3Layout.cpp b/src/Hy3Layout.cpp
110index 780e0a722a68697b5afef1f3e9d3206635c4d978..f3704b0fe8942774e220b306595f84f105e38250 100644
111--- a/src/Hy3Layout.cpp
112+++ b/src/Hy3Layout.cpp
113@@ -1,5 +1,5 @@
114-#include "globals.hpp"
115 #include "Hy3Layout.hpp"
116+#include "globals.hpp"
117 #include "SelectionHook.hpp"
118 
119 #include <hyprland/src/Compositor.hpp>
120@@ -8,12 +8,15 @@
121 #include <sstream>
122 
123 void errorNotif() {
124-	HyprlandAPI::addNotificationV2(PHANDLE, {
125-		{"text", "Something has gone very wrong. Check the log for details."},
126-		{"time", (uint64_t)10000},
127-		{"color", CColor(1.0, 0.0, 0.0, 1.0)},
128-		{"icon", ICON_ERROR},
129-	});
130+	HyprlandAPI::addNotificationV2(
131+	    PHANDLE,
132+	    {
133+	        {"text", "Something has gone very wrong. Check the log for details."},
134+	        {"time", (uint64_t) 10000},
135+	        {"color", CColor(1.0, 0.0, 0.0, 1.0)},
136+	        {"icon", ICON_ERROR},
137+	    }
138+	);
139 }
140 
141 Hy3GroupData::Hy3GroupData(Hy3GroupLayout layout): layout(layout) {}
142@@ -32,22 +35,19 @@ Hy3GroupData::~Hy3GroupData() {
143 	if (this->tab_bar != nullptr) this->tab_bar->bar.beginDestroy();
144 }
145 
146-Hy3NodeData::Hy3NodeData(): Hy3NodeData((CWindow*)nullptr) {}
147+Hy3NodeData::Hy3NodeData(): Hy3NodeData((CWindow*) nullptr) {}
148 
149-Hy3NodeData::Hy3NodeData(CWindow *window): type(Hy3NodeData::Window) {
150-	this->as_window = window;
151-}
152+Hy3NodeData::Hy3NodeData(CWindow* window): type(Hy3NodeData::Window) { this->as_window = window; }
153 
154 Hy3NodeData::Hy3NodeData(Hy3GroupData group): type(Hy3NodeData::Group) {
155-	new(&this->as_group) Hy3GroupData(std::move(group));
156+	new (&this->as_group) Hy3GroupData(std::move(group));
157 }
158 
159 Hy3NodeData::Hy3NodeData(Hy3GroupLayout layout): Hy3NodeData(Hy3GroupData(layout)) {}
160 
161 Hy3NodeData::~Hy3NodeData() {
162 	switch (this->type) {
163-	case Hy3NodeData::Window:
164-		break;
165+	case Hy3NodeData::Window: break;
166 	case Hy3NodeData::Group:
167 		this->as_group.~Hy3GroupData();
168 
169@@ -58,19 +58,27 @@ Hy3NodeData::~Hy3NodeData() {
170 }
171 
172 Hy3NodeData::Hy3NodeData(Hy3NodeData&& from): type(from.type) {
173-	Debug::log(LOG, "Move CTor type matches? %d is group? %d", this->type == from.type, this->type == Hy3NodeData::Group);
174+	Debug::log(
175+	    LOG,
176+	    "Move CTor type matches? %d is group? %d",
177+	    this->type == from.type,
178+	    this->type == Hy3NodeData::Group
179+	);
180+
181 	switch (from.type) {
182-	case Hy3NodeData::Window:
183-		this->as_window = from.as_window;
184-		break;
185-	case Hy3NodeData::Group:
186-		new(&this->as_group) Hy3GroupData(std::move(from.as_group));
187-		break;
188+	case Hy3NodeData::Window: this->as_window = from.as_window; break;
189+	case Hy3NodeData::Group: new (&this->as_group) Hy3GroupData(std::move(from.as_group)); break;
190 	}
191 }
192 
193 Hy3NodeData& Hy3NodeData::operator=(Hy3NodeData&& from) {
194-	Debug::log(LOG, "operator= type matches? %d is group? %d", this->type == from.type, this->type == Hy3NodeData::Group);
195+	Debug::log(
196+	    LOG,
197+	    "operator= type matches? %d is group? %d",
198+	    this->type == from.type,
199+	    this->type == Hy3NodeData::Group
200+	);
201+
202 	if (this->type == Hy3NodeData::Group) {
203 		this->as_group.~Hy3GroupData();
204 	}
205@@ -78,12 +86,8 @@ Hy3NodeData& Hy3NodeData::operator=(Hy3NodeData&& from) {
206 	this->type = from.type;
207 
208 	switch (this->type) {
209-	case Hy3NodeData::Window:
210-		this->as_window = from.as_window;
211-		break;
212-	case Hy3NodeData::Group:
213diff --git a/src/Hy3Layout.hpp b/src/Hy3Layout.hpp
214index 3545c6683862f3deb3bb3651351fbbab3240185f..7f06632d58572877143bb4a10c5c3fd909582352 100644
215--- a/src/Hy3Layout.hpp
216+++ b/src/Hy3Layout.hpp
217@@ -1,11 +1,11 @@
218 #pragma once
219 
220+#include <hyprland/src/layout/IHyprLayout.hpp>
221+#include <list>
222+
223 struct Hy3Node;
224 #include "TabGroup.hpp"
225 
226-#include <list>
227-#include <hyprland/src/layout/IHyprLayout.hpp>
228-
229 class Hy3Layout;
230 struct Hy3Node;
231 
232@@ -58,7 +58,7 @@ public:
233 	Hy3NodeData& operator=(CWindow*);
234 	Hy3NodeData& operator=(Hy3GroupLayout);
235 
236-	//private: - I give up, C++ wins
237+	// private: - I give up, C++ wins
238 	Hy3NodeData(Hy3GroupData);
239 	Hy3NodeData(Hy3NodeData&&);
240 	Hy3NodeData& operator=(Hy3NodeData&&);
241@@ -98,7 +98,8 @@ struct Hy3Node {
242 	// Attempt to swallow a group. returns true if swallowed
243 	static bool swallowGroups(Hy3Node*);
244 	// Remove this node from its parent, deleting the parent if it was
245-	// the only child and recursing if the parent was the only child of it's parent.
246+	// the only child and recursing if the parent was the only child of it's
247+	// parent.
248 	Hy3Node* removeFromParentRecursive();
249 
250 	// Replace this node with a group, returning this node's new address.
251@@ -149,6 +150,7 @@ public:
252 
253 	std::list<Hy3Node> nodes;
254 	std::list<Hy3TabGroup> tab_groups;
255+
256 private:
257 	struct {
258 		bool started = false;
259@@ -160,9 +162,9 @@ private:
260 	Hy3Node* getNodeFromWindow(CWindow*);
261 	void applyNodeDataToWindow(Hy3Node*, bool force = false);
262 
263-	// if shift is true, shift the window in the given direction, returning nullptr,
264-	// if shift is false, return the window in the given direction or nullptr.
265-	// if once is true, only one group will be broken out of / into
266+	// if shift is true, shift the window in the given direction, returning
267+	// nullptr, if shift is false, return the window in the given direction or
268+	// nullptr. if once is true, only one group will be broken out of / into
269 	Hy3Node* shiftOrGetFocus(Hy3Node&, ShiftDirection, bool, bool);
270 
271 	friend struct Hy3Node;
272diff --git a/src/SelectionHook.cpp b/src/SelectionHook.cpp
273index 2441fe4e4e8dda983764d5f30d66619b534bcacc..bbf63ae1a4a7c41410ffdad35850ef11f94b1a98 100644
274--- a/src/SelectionHook.cpp
275+++ b/src/SelectionHook.cpp
276@@ -1,53 +1,68 @@
277 #include "globals.hpp"
278-#include <hyprland/src/plugins/PluginAPI.hpp>
279 #include <hyprland/src/Compositor.hpp>
280+#include <hyprland/src/plugins/PluginAPI.hpp>
281 
282 namespace selection_hook {
283-	inline CFunctionHook* g_LastSelectionHook = nullptr;
284+inline CFunctionHook* g_LastSelectionHook = nullptr;
285 
286-	void hook_updateDecos(void* thisptr, CWindow* window) {
287-		bool explicitly_selected = g_Hy3Layout->shouldRenderSelected(window);
288-		Debug::log(LOG, "update decos for %p - selected: %d", window, explicitly_selected);
289+void hook_updateDecos(void* thisptr, CWindow* window) {
290+	bool explicitly_selected = g_Hy3Layout->shouldRenderSelected(window);
291+	Debug::log(LOG, "update decos for %p - selected: %d", window, explicitly_selected);
292 
293-		auto* lastWindow = g_pCompositor->m_pLastWindow;
294-		if (explicitly_selected) {
295-			g_pCompositor->m_pLastWindow = window;
296-		}
297+	auto* lastWindow = g_pCompositor->m_pLastWindow;
298+	if (explicitly_selected) {
299+		g_pCompositor->m_pLastWindow = window;
300+	}
301 
302-		((void (*)(void*, CWindow*)) g_LastSelectionHook->m_pOriginal)(thisptr, window);
303+	((void (*)(void*, CWindow*)) g_LastSelectionHook->m_pOriginal)(thisptr, window);
304 
305-		if (explicitly_selected) {
306-			g_pCompositor->m_pLastWindow = lastWindow;
307-		}
308+	if (explicitly_selected) {
309+		g_pCompositor->m_pLastWindow = lastWindow;
310 	}
311+}
312 
313-	void init() {
314-		static const auto decoUpdateCandidates = HyprlandAPI::findFunctionsByName(PHANDLE, "updateWindowAnimatedDecorationValues");
315-
316-		if (decoUpdateCandidates.size() != 1) {
317-			g_LastSelectionHook = nullptr;
318-			Debug::log(ERR, "Expected one matching function to hook for \"updateWindowAnimatedDecorationValues\", found %d", decoUpdateCandidates.size());
319-			HyprlandAPI::addNotificationV2(PHANDLE, {
320-				{"text", "Failed to load function hooks: \"updateWindowAnimatedDecorationValues\""},
321-				{"time", (uint64_t)10000},
322-				{"color", CColor(1.0, 0.0, 0.0, 1.0)},
323-				{"icon", ICON_ERROR},
324-			});
325-			return;
326-		}
327-
328-		g_LastSelectionHook = HyprlandAPI::createFunctionHook(PHANDLE, decoUpdateCandidates[0].address, (void*)&hook_updateDecos);
329+void init() {
330+	static const auto decoUpdateCandidates
331+	    = HyprlandAPI::findFunctionsByName(PHANDLE, "updateWindowAnimatedDecorationValues");
332+
333+	if (decoUpdateCandidates.size() != 1) {
334+		g_LastSelectionHook = nullptr;
335+		Debug::log(
336+		    ERR,
337+		    "Expected one matching function to hook for "
338+		    "\"updateWindowAnimatedDecorationValues\", found %d",
339+		    decoUpdateCandidates.size()
340+		);
341+		HyprlandAPI::addNotificationV2(
342+		    PHANDLE,
343+		    {
344+		        {"text",
345+		         "Failed to load function hooks: "
346+		         "\"updateWindowAnimatedDecorationValues\""},
347+		        {"time", (uint64_t) 10000},
348+		        {"color", CColor(1.0, 0.0, 0.0, 1.0)},
349+		        {"icon", ICON_ERROR},
350+		    }
351+		);
352+		return;
353 	}
354 
355-	void enable() {
356-		if (g_LastSelectionHook != nullptr) {
357-			g_LastSelectionHook->hook();
358-		}
359+	g_LastSelectionHook = HyprlandAPI::createFunctionHook(
360+	    PHANDLE,
361+	    decoUpdateCandidates[0].address,
362+	    (void*) &hook_updateDecos
363+	);
364+}
365+
366+void enable() {
367+	if (g_LastSelectionHook != nullptr) {
368+		g_LastSelectionHook->hook();
369 	}
370+}
371 
372-	void disable() {
373-		if (g_LastSelectionHook != nullptr) {
374-			g_LastSelectionHook->unhook();
375-		}
376diff --git a/src/SelectionHook.hpp b/src/SelectionHook.hpp
377index 3f38e53871b1b11cd891d888966ac40ae35f3e18..6040bdb6558626daae4a15dd30d31c44ab37af3f 100644
378--- a/src/SelectionHook.hpp
379+++ b/src/SelectionHook.hpp
380@@ -1,7 +1,7 @@
381 #pragma once
382 
383 namespace selection_hook {
384-	void init();
385-	void enable();
386-	void disable();
387-}
388+void init();
389+void enable();
390+void disable();
391+} // namespace selection_hook
392diff --git a/src/TabGroup.cpp b/src/TabGroup.cpp
393index 2e0e52e7a636802a2fb0cd1c8b6acc77e77681ab..eb8d7f9766ef414c6ee70a6e08e74c7f7aa605d9 100644
394--- a/src/TabGroup.cpp
395+++ b/src/TabGroup.cpp
396@@ -1,18 +1,31 @@
397-#include "globals.hpp"
398 #include "TabGroup.hpp"
399+#include "globals.hpp"
400 #include "Hy3Layout.hpp"
401 
402-#include <hyprland/src/Compositor.hpp>
403 #include <cairo/cairo.h>
404-#include <pango/pangocairo.h>
405+#include <hyprland/src/Compositor.hpp>
406 #include <hyprland/src/helpers/Color.hpp>
407 #include <hyprland/src/plugins/PluginAPI.hpp>
408 #include <hyprland/src/render/OpenGL.hpp>
409+#include <pango/pangocairo.h>
410 #include <pixman.h>
411 
412 Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_bar), node(node) {
413-	this->offset.create(AVARTYPE_FLOAT, -1.0f, g_pConfigManager->getAnimationPropertyConfig("windowsMove"), nullptr, AVARDAMAGE_NONE);
414-	this->width.create(AVARTYPE_FLOAT, -1.0f, g_pConfigManager->getAnimationPropertyConfig("windowsMove"), nullptr, AVARDAMAGE_NONE);
415+	this->offset.create(
416+	    AVARTYPE_FLOAT,
417+	    -1.0f,
418+	    g_pConfigManager->getAnimationPropertyConfig("windowsMove"),
419+	    nullptr,
420+	    AVARDAMAGE_NONE
421+	);
422+
423+	this->width.create(
424+	    AVARTYPE_FLOAT,
425+	    -1.0f,
426+	    g_pConfigManager->getAnimationPropertyConfig("windowsMove"),
427+	    nullptr,
428+	    AVARDAMAGE_NONE
429+	);
430 
431 	this->offset.registerVar();
432 	this->width.registerVar();
433@@ -26,9 +39,7 @@ Hy3TabBarEntry::Hy3TabBarEntry(Hy3TabBar& tab_bar, Hy3Node& node): tab_bar(tab_b
434 	this->urgent = node.isUrgent();
435 }
436 
437-bool Hy3TabBarEntry::operator==(const Hy3Node& node) const {
438-	return this->node == node;
439-}
440+bool Hy3TabBarEntry::operator==(const Hy3Node& node) const { return this->node == node; }
441 
442 bool Hy3TabBarEntry::operator==(const Hy3TabBarEntry& entry) const {
443 	return this->node == entry.node;
444@@ -56,6 +67,7 @@ void Hy3TabBarEntry::setWindowTitle(std::string title) {
445 }
446 
447 void Hy3TabBarEntry::prepareTexture(float scale, wlr_box& box) {
448+	// clang-format off
449 	static const auto* s_rounding = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:rounding")->intValue;
450 	static const auto* render_text = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:render_text")->intValue;
451 	static const auto* text_font = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:text_font")->strValue;
452@@ -67,6 +79,7 @@ void Hy3TabBarEntry::prepareTexture(float scale, wlr_box& box) {
453 	static const auto* col_text_active = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:col.text.active")->intValue;
454 	static const auto* col_text_urgent = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:col.text.urgent")->intValue;
455 	static const auto* col_text_inactive = &HyprlandAPI::getConfigValue(PHANDLE, "plugin:hy3:tabs:col.text.inactive")->intValue;
456+	// clang-format on
457 
458 	auto width = box.width;
459 	auto height = box.height;
460@@ -74,22 +87,25 @@ void Hy3TabBarEntry::prepareTexture(float scale, wlr_box& box) {
461 	auto rounding = std::min((double) *s_rounding, std::min(width * 0.5, height * 0.5));
462 
463 	if (this->texture.m_iTexID == 0
464+	    // clang-format off
465 			|| this->last_render.x != box.x
466 			|| this->last_render.y != box.y
467-			|| this->last_render.focused != this->focused
468+	    || this->last_render.focused != this->focused
469 			|| this->last_render.urgent != this->urgent
470-			|| this->last_render.window_title != this->window_title
471-			|| this->last_render.rounding != rounding
472+	    || this->last_render.window_title != this->window_title
473+	    || this->last_render.rounding != rounding
474 			|| this->last_render.text_font != *text_font
475-			|| this->last_render.text_height != *text_height
476-			|| this->last_render.text_padding != *text_padding
477-			|| this->last_render.col_active != *col_active
478+	    || this->last_render.text_height != *text_height
479+	    || this->last_render.text_padding != *text_padding
480+	    || this->last_render.col_active != *col_active
481 			|| this->last_render.col_urgent != *col_urgent
482-			|| this->last_render.col_inactive != *col_inactive
483-			|| this->last_render.col_text_active != *col_text_active
484-			|| this->last_render.col_text_urgent != *col_text_urgent
485-			|| this->last_render.col_text_inactive != *col_text_inactive
486-	) {
487+	    || this->last_render.col_inactive != *col_inactive
488+	    || this->last_render.col_text_active != *col_text_active
489+	    || this->last_render.col_text_urgent != *col_text_urgent
490+	    || this->last_render.col_text_inactive != *col_text_inactive
491+	    // clang-format on
492+	)
493+	{
494 		this->last_render.x = box.x;
495 		this->last_render.y = box.y;
496diff --git a/src/TabGroup.hpp b/src/TabGroup.hpp
497index e463f92030b523d5d50b80a0fe74c2b5e9f8ae90..dc12a00382c915efc2d1e13155ae13c3b2ed711e 100644
498--- a/src/TabGroup.hpp
499+++ b/src/TabGroup.hpp
500@@ -1,7 +1,6 @@
501 #pragma once
502 
503-#include <hyprland/src/helpers/AnimatedVariable.hpp>
504-#include <hyprland/src/helpers/Vector2D.hpp>
505+#include <hyprland/src/Compositor.hpp>
506 #include <list>
507 #include <memory>
508 #include <vector>
509@@ -10,7 +9,6 @@ class Hy3TabGroup;
510 class Hy3TabBar;
511 
512 #include "Hy3Layout.hpp"
513-#include <hyprland/src/render/Texture.hpp>
514 
515 struct Hy3TabBarEntry {
516 	std::string window_title;
517@@ -18,7 +16,7 @@ struct Hy3TabBarEntry {
518 	bool urgent = false;
519 	CTexture texture;
520 	CAnimatedVariable offset; // offset 0, 0.0-1.0 of total bar
521-	CAnimatedVariable width; // 0.0-1.0 of total bar
522+	CAnimatedVariable width;  // 0.0-1.0 of total bar
523 	Hy3TabBar& tab_bar;
524 	Hy3Node& node; // only used for comparioson. do not deref.
525 
526@@ -68,6 +66,7 @@ public:
527 	void setSize(Vector2D);
528 
529 	std::list<Hy3TabBarEntry> entries;
530+
531 private:
532 	Hy3Node* focused_node = nullptr;
533 	Vector2D size;
534diff --git a/src/globals.hpp b/src/globals.hpp
535index c955ee3af80c17c85e695c13265d81186fed67c1..ed7522fef96055c56c7629d770f20e9b46a4c2e5 100644
536--- a/src/globals.hpp
537+++ b/src/globals.hpp
538@@ -1,5 +1,5 @@
539-#include <hyprland/src/plugins/PluginAPI.hpp>
540 #include "Hy3Layout.hpp"
541+#include <hyprland/src/plugins/PluginAPI.hpp>
542 
543 inline HANDLE PHANDLE = nullptr;
544 inline std::unique_ptr<Hy3Layout> g_Hy3Layout;
545diff --git a/src/main.cpp b/src/main.cpp
546index e92fac1302333c1d8a4c80d563c97a5cf0a97c7c..3c4374acbd89dc708eeb2726be3a3054f5e225de 100644
547--- a/src/main.cpp
548+++ b/src/main.cpp
549@@ -1,14 +1,12 @@
550 #include <optional>
551 
552-#include <hyprland/src/plugins/PluginAPI.hpp>
553 #include <hyprland/src/Compositor.hpp>
554+#include <hyprland/src/plugins/PluginAPI.hpp>
555 
556 #include "globals.hpp"
557 #include "SelectionHook.hpp"
558 
559-APICALL EXPORT std::string PLUGIN_API_VERSION() {
560-	return HYPRLAND_API_VERSION;
561-}
562+APICALL EXPORT std::string PLUGIN_API_VERSION() { return HYPRLAND_API_VERSION; }
563 
564 // return a window if a window action makes sense now
565 CWindow* window_for_action() {
566@@ -112,22 +110,58 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
567 
568 	selection_hook::init();
569 
570-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:no_gaps_when_only", SConfigValue{.intValue = 0});
571-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:group_inset", SConfigValue{.intValue = 10});
572-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:height", SConfigValue{.intValue = 15});
573-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:padding", SConfigValue{.intValue = 5});
574-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:from_top", SConfigValue{.intValue = 0});
575-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:rounding", SConfigValue{.intValue = 3});
576-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:render_text", SConfigValue{.intValue = 1});
577-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:text_font", SConfigValue{.strValue = "Sans"});
578-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:text_height", SConfigValue{.intValue = 8});
579-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:text_padding", SConfigValue{.intValue = 3});
580-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:col.active", SConfigValue{.intValue = 0xff32b4ff});
581-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:col.urgent", SConfigValue{.intValue = 0xffff4f4f});
582-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:col.inactive", SConfigValue{.intValue = 0x80808080});
583-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:col.text.active", SConfigValue{.intValue = 0xff000000});
584-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:col.text.urgent", SConfigValue{.intValue = 0xff000000});
585-	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:col.text.inactive", SConfigValue{.intValue = 0xff000000});
586+	HyprlandAPI::addConfigValue(
587+	    PHANDLE,
588+	    "plugin:hy3:no_gaps_when_only",
589+	    SConfigValue {.intValue = 0}
590+	);
591+	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:group_inset", SConfigValue {.intValue = 10});
592+	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:height", SConfigValue {.intValue = 15});
593+	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:padding", SConfigValue {.intValue = 5});
594+	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:from_top", SConfigValue {.intValue = 0});
595+	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:rounding", SConfigValue {.intValue = 3});
596+	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:render_text", SConfigValue {.intValue = 1});
597+	HyprlandAPI::addConfigValue(
598+	    PHANDLE,
599+	    "plugin:hy3:tabs:text_font",
600+	    SConfigValue {.strValue = "Sans"}
601+	);
602+	HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:tabs:text_height", SConfigValue {.intValue = 8});
603+	HyprlandAPI::addConfigValue(
604+	    PHANDLE,
605+	    "plugin:hy3:tabs:text_padding",
606+	    SConfigValue {.intValue = 3}
607+	);
608+	HyprlandAPI::addConfigValue(
609+	    PHANDLE,
610+	    "plugin:hy3:tabs:col.active",
611+	    SConfigValue {.intValue = 0xff32b4ff}
612+	);
613+	HyprlandAPI::addConfigValue(
614+	    PHANDLE,
615+	    "plugin:hy3:tabs:col.urgent",
616+	    SConfigValue {.intValue = 0xffff4f4f}
617+	);
618+	HyprlandAPI::addConfigValue(
619+	    PHANDLE,
620+	    "plugin:hy3:tabs:col.inactive",
621+	    SConfigValue {.intValue = 0x80808080}
622+	);
623+	HyprlandAPI::addConfigValue(
624+	    PHANDLE,
625+	    "plugin:hy3:tabs:col.text.active",
626+	    SConfigValue {.intValue = 0xff000000}
627+	);
628+	HyprlandAPI::addConfigValue(
629+	    PHANDLE,
630+	    "plugin:hy3:tabs:col.text.urgent",
631+	    SConfigValue {.intValue = 0xff000000}
632+	);
633+	HyprlandAPI::addConfigValue(
634+	    PHANDLE,
635+	    "plugin:hy3:tabs:col.text.inactive",
636+	    SConfigValue {.intValue = 0xff000000}
637+	);
638 
639 	g_Hy3Layout = std::make_unique<Hy3Layout>();
640 	HyprlandAPI::addLayout(PHANDLE, "hy3", g_Hy3Layout.get());