This commit is contained in:
RafayAhmad7548 2024-06-16 18:53:25 +05:00
parent 37776af5db
commit ab03d5f10c
4045 changed files with 286212 additions and 3 deletions

View file

@ -0,0 +1,32 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activewindow", [void](void* ptr, ){
})
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,31 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activeWindow", [](void* ptr, SCallbackInfo& window, std::any a){
std::cout<<"window switched\n";
});
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,27 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[MyPlugin] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[MyPlugin] Version mismatch");
}
HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", [](void* data, SCallbackInfo& info, std::any event){
std::cout<<"Nice\n";
});
return {"sttracker", "Screen Time Tracker", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){
}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
PHLWINDOW window = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,26 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[MyPlugin] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[MyPlugin] Version mismatch");
}
std::cout<<"Plugin Started\n";
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,35 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
WINDOW.get();
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
PHLWINDOW window = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,4 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
std::cout<<data;
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
auto callback = HyprlandAPI::registerCallbackDynamic(handle, "activewindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,27 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[MyPlugin] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[MyPlugin] Version mismatch");
}
HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", [](void* data, SCallbackInfo& info, std::any event){
});
return {"sttracker", "Screen Time Tracker", "Me", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){
}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,35 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
CWindow* a = WINDOW.get();
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,25 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[MyPlugin] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[MyPlugin] Version mismatch");
}
return {"sttracker", "Screen Time Tracker", "Me", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){
}

View file

@ -0,0 +1,26 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
auto callback = HyprlandAPI::registerCallbackDynamic(handle, "openWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,24 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[MyPlugin] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[MyPlugin] Version mismatch");
}
// ...
return {"MyPlugin", "An amazing plugin that is going to change the world!", "Me", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){
// ...
}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,27 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[MyPlugin] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[MyPlugin] Version mismatch");
}
HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", [](void* data, SCallbackInfo& info, std::any event){
std::cout<<"Nice\n";
});
return {"sttracker", "Screen Time Tracker", "Me", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){
}

View file

@ -0,0 +1 @@
{"version":1,"resource":"file:///home/rafayahmad/Stuff/Coding/C%2B%2B/sttracker/main.cpp","entries":[{"id":"WK5s.cpp","timestamp":1715872358474},{"id":"N84O.cpp","timestamp":1715872587771},{"id":"dhVy.cpp","timestamp":1715872655861},{"id":"tcMa.cpp","timestamp":1715873675511},{"id":"3dxD.cpp","timestamp":1716432918229},{"id":"Fb3E.cpp","timestamp":1716620419737},{"id":"aVUZ.cpp","timestamp":1716620456155},{"id":"pdiQ.cpp","timestamp":1716620477242},{"id":"wDz9.cpp","timestamp":1716620514886},{"id":"7Epx.cpp","timestamp":1716622467139},{"id":"XtmA.cpp","timestamp":1716623711742},{"id":"01iS.cpp","timestamp":1716638020272},{"id":"fQnI.cpp","timestamp":1716638104524},{"id":"rwda.cpp","timestamp":1716638210182},{"id":"hflS.cpp","timestamp":1716638253260},{"id":"0crK.cpp","timestamp":1716638602073},{"id":"gKVN.cpp","timestamp":1716638661873},{"id":"ruZU.cpp","timestamp":1716638855603},{"id":"m2kM.cpp","timestamp":1716638866019},{"id":"Y6Ms.cpp","timestamp":1716638883755},{"id":"tOQL.cpp","timestamp":1716639075646},{"id":"vytY.cpp","timestamp":1716639090835},{"id":"zKny.cpp","timestamp":1716639120939},{"id":"kPWT.cpp","timestamp":1716639220252},{"id":"Y8N9.cpp","timestamp":1716639325799},{"id":"LRbL.cpp","timestamp":1716639385999},{"id":"gBPd.cpp","timestamp":1716639543667},{"id":"mi1M.cpp","timestamp":1716639688614},{"id":"xtcU.cpp","timestamp":1716639904234},{"id":"0QGy.cpp","timestamp":1716641309320},{"id":"JaV6.cpp","timestamp":1716641500350},{"id":"pHLV.cpp","timestamp":1716641516126},{"id":"MYt8.cpp","timestamp":1716641546095},{"id":"D8oz.cpp","timestamp":1716642704748},{"id":"3sY4.cpp","timestamp":1716642730538},{"id":"l6hm.cpp","timestamp":1716642780544},{"id":"Q4PN.cpp","timestamp":1716642799637},{"id":"bxVm.cpp","timestamp":1716642810281},{"id":"Zbuy.cpp","timestamp":1716642968316},{"id":"mX6z.cpp","timestamp":1716642988078},{"id":"l4wa.cpp","timestamp":1716643033635},{"id":"MmkP.cpp","timestamp":1716643063427},{"id":"qEQK.cpp","timestamp":1716643093145},{"id":"Bhy9.cpp","timestamp":1716643112030},{"id":"jEdi.cpp","timestamp":1716822859772},{"id":"wDSh.cpp","timestamp":1716822886692},{"id":"TGtO.cpp","timestamp":1716822928352},{"id":"wieI.cpp","timestamp":1716822984673},{"id":"0vjo.cpp","timestamp":1716822998836},{"id":"JvzF.cpp","timestamp":1716823039890}]}

View file

@ -0,0 +1,31 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activewindow", [](void* ptr, SCallbackInfo& window, std::any a){
});
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
auto callback = HyprlandAPI::registerCallbackDynamic(handle, "activewindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,31 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activeWindow", [](void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
});
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,31 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activewindow", [](void* ptr, SCallbackInfo& window, std::any a){
std::cout<<"window switched\n";
});
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "openWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,35 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
std::vector<std::string> a;
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW window = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activeWindow", [](void* self, SCallbackInfo& info, std::any data){
});
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,35 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
WINDOW.operator->();
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
auto callback = HyprlandAPI::registerCallbackDynamic(handle, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,34 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
data.type();
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,21 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[MyPlugin] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[MyPlugin] Version mismatch");
}
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,35 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
WINDOW.get();
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,36 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activeWindow", [](void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
});
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,31 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activewindow", [](void* ptr, SCallbackInfo& window, std::any a){
});
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activewindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,27 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[MyPlugin] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[MyPlugin] Version mismatch");
}
HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", [](void* data, SCallbackInfo& info, std::any event){
std::cout<<"Nice\n";
});
return {"sttracker", "Screen Time Tracker", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){
}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "activewindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,35 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
WINDOW.get();
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,22 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[MyPlugin] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[MyPlugin] Version mismatch");
}
std::cout<<"Plugin Started\n";
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,35 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
const PHLWINDOW WINDOW = std::any_cast<PHLWINDOW>(data);
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
static auto P = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
auto callback = HyprlandAPI::registerCallbackDynamic(PHANDLE, "activeWindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}

View file

@ -0,0 +1,33 @@
#include <hyprland/src/plugins/PluginAPI.hpp>
inline HANDLE PHANDLE = nullptr;
APICALL EXPORT std::string PLUGIN_API_VERSION(){
return HYPRLAND_API_VERSION;
}
void onChangeFocus(void* self, SCallbackInfo& info, std::any data){
std::cout<<"window switched\n";
}
APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle){
PHANDLE = handle;
const std::string HASH = __hyprland_api_get_hash();
// ALWAYS add this to your plugins. It will prevent random crashes coming from
// mismatched header versions.
if(HASH != GIT_COMMIT_HASH){
HyprlandAPI::addNotification(PHANDLE, "[sttracker] Mismatched headers! Can't proceed.", CColor{1.0, 0.2, 0.2, 1.0}, 5000);
throw std::runtime_error("[sttracker] Version mismatch");
}
std::cout<<"Plugin Started\n";
HyprlandAPI::registerCallbackDynamic(handle, "openwindow", onChangeFocus);
return {"sttracker", "An amazing plugin that is going to change the world!", "rafay", "1.0"};
}
APICALL EXPORT void PLUGIN_EXIT(){}