hy3/src/main.cpp

60 lines
1.7 KiB
C++
Raw Normal View History

2023-05-10 00:42:53 -07:00
#include <optional>
#include <hyprland/src/Compositor.hpp>
2023-06-07 03:22:17 -07:00
#include <hyprland/src/plugins/PluginAPI.hpp>
2023-06-28 21:36:08 -07:00
#include "dispatchers.hpp"
2023-04-17 00:53:02 -07:00
#include "globals.hpp"
#include "SelectionHook.hpp"
2023-06-07 03:22:17 -07:00
APICALL EXPORT std::string PLUGIN_API_VERSION() { return HYPRLAND_API_VERSION; }
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
PHANDLE = handle;
selection_hook::init();
2023-07-31 23:00:25 -07:00
#define CONF(NAME, TYPE, VALUE) \
HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:" NAME, SConfigValue {.TYPE##Value = VALUE})
// general
CONF("no_gaps_when_only", int, 0);
CONF("node_collapse_policy", int, 2);
CONF("group_inset", int, 10);
CONF("tab_first_window", int, 0);
2023-07-31 23:00:25 -07:00
// tabs
CONF("tabs:height", int, 15);
CONF("tabs:padding", int, 5);
CONF("tabs:from_top", int, 0);
CONF("tabs:rounding", int, 3);
CONF("tabs:render_text", int, 1);
CONF("tabs:text_font", str, "Sans");
CONF("tabs:text_height", int, 8);
CONF("tabs:text_padding", int, 3);
CONF("tabs:col.active", int, 0xff32b4ff);
CONF("tabs:col.urgent", int, 0xffff4f4f);
CONF("tabs:col.inactive", int, 0x80808080);
CONF("tabs:col.text.active", int, 0xff000000);
CONF("tabs:col.text.urgent", int, 0xff000000);
CONF("tabs:col.text.inactive", int, 0xff000000);
2023-08-01 01:00:56 -07:00
// autotiling
CONF("autotile:enable", int, 0);
CONF("autotile:ephemeral_groups", int, 1);
CONF("autotile:trigger_height", int, 0);
CONF("autotile:trigger_width", int, 0);
CONF("autotile:workspaces", str, "all");
2023-08-01 01:00:56 -07:00
2023-07-31 23:00:25 -07:00
#undef CONF
2023-04-17 00:53:02 -07:00
g_Hy3Layout = std::make_unique<Hy3Layout>();
HyprlandAPI::addLayout(PHANDLE, "hy3", g_Hy3Layout.get());
2023-06-28 21:36:08 -07:00
registerDispatchers();
return {"hy3", "i3 like layout for hyprland", "outfoxxed", "0.1"};
}
APICALL EXPORT void PLUGIN_EXIT() {}