mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 16:13:21 +02:00
parent
5fee8c5545
commit
f2793f3bd3
5 changed files with 22 additions and 19 deletions
14
README.md
14
README.md
|
@ -142,23 +142,23 @@ plugin:dynamic-cursors {
|
||||||
stretch {
|
stretch {
|
||||||
|
|
||||||
# controls how much the cursor is stretched
|
# controls how much the cursor is stretched
|
||||||
# this value controls at which speed (px/s) the full stretch
|
# this value controls at which speed (px/s) the full stretch is reached
|
||||||
limit = 3000
|
limit = 3000
|
||||||
|
|
||||||
# relationship between speed and tilt, supports these vaules:
|
# relationship between speed and stretch amount, supports these vaules:
|
||||||
# linear - a linear function is used
|
# linear - a linear function is used
|
||||||
# quadratic - a quadratic function is used
|
# quadratic - a quadratic function is used
|
||||||
# negative_quadratic - negative version of the quadratic one, feels more aggressive
|
# negative_quadratic - negative version of the quadratic one, feels more aggressive
|
||||||
function = quadratic
|
function = quadratic
|
||||||
}
|
}
|
||||||
|
|
||||||
# enable shake to find
|
# configure shake to find
|
||||||
# magnifies the cursor if its is being shaken
|
|
||||||
shake = true
|
|
||||||
|
|
||||||
# for when shake = true
|
|
||||||
shake {
|
shake {
|
||||||
|
|
||||||
|
# enables shake to find
|
||||||
|
# magnifies the cursor if its is being shaken
|
||||||
|
enabled = true
|
||||||
|
|
||||||
# controls how soon a shake is detected
|
# controls how soon a shake is detected
|
||||||
# lower values mean sooner
|
# lower values mean sooner
|
||||||
threshold = 4.0
|
threshold = 4.0
|
||||||
|
|
|
@ -4,20 +4,23 @@
|
||||||
|
|
||||||
#define CONFIG_ENABLED "plugin:dynamic-cursors:enabled"
|
#define CONFIG_ENABLED "plugin:dynamic-cursors:enabled"
|
||||||
#define CONFIG_MODE "plugin:dynamic-cursors:mode"
|
#define CONFIG_MODE "plugin:dynamic-cursors:mode"
|
||||||
#define CONFIG_SHAKE "plugin:dynamic-cursors:shake"
|
|
||||||
#define CONFIG_THRESHOLD "plugin:dynamic-cursors:threshold"
|
#define CONFIG_THRESHOLD "plugin:dynamic-cursors:threshold"
|
||||||
|
#define CONFIG_HW_DEBUG "plugin:dynamic-cursors:hw_debug"
|
||||||
|
|
||||||
|
#define CONFIG_SHAKE "plugin:dynamic-cursors:shake:enabled"
|
||||||
#define CONFIG_SHAKE_NEAREST "plugin:dynamic-cursors:shake:nearest"
|
#define CONFIG_SHAKE_NEAREST "plugin:dynamic-cursors:shake:nearest"
|
||||||
#define CONFIG_SHAKE_THRESHOLD "plugin:dynamic-cursors:shake:threshold"
|
#define CONFIG_SHAKE_THRESHOLD "plugin:dynamic-cursors:shake:threshold"
|
||||||
#define CONFIG_SHAKE_FACTOR "plugin:dynamic-cursors:shake:factor"
|
#define CONFIG_SHAKE_FACTOR "plugin:dynamic-cursors:shake:factor"
|
||||||
#define CONFIG_SHAKE_EFFECTS "plugin:dynamic-cursors:shake:effects"
|
#define CONFIG_SHAKE_EFFECTS "plugin:dynamic-cursors:shake:effects"
|
||||||
#define CONFIG_SHAKE_IPC "plugin:dynamic-cursors:shake:ipc"
|
#define CONFIG_SHAKE_IPC "plugin:dynamic-cursors:shake:ipc"
|
||||||
#define CONFIG_LENGTH "plugin:dynamic-cursors:rotate:length"
|
|
||||||
|
#define CONFIG_ROTATE_LENGTH "plugin:dynamic-cursors:rotate:length"
|
||||||
#define CONFIG_ROTATE_OFFSET "plugin:dynamic-cursors:rotate:offset"
|
#define CONFIG_ROTATE_OFFSET "plugin:dynamic-cursors:rotate:offset"
|
||||||
#define CONFIG_MASS "plugin:dynamic-cursors:tilt:limit"
|
|
||||||
#define CONFIG_FUNCTION "plugin:dynamic-cursors:tilt:function"
|
#define CONFIG_TILT_LIMIT "plugin:dynamic-cursors:tilt:limit"
|
||||||
|
#define CONFIG_TILT_FUNCTION "plugin:dynamic-cursors:tilt:function"
|
||||||
|
|
||||||
#define CONFIG_STRETCH_LIMIT "plugin:dynamic-cursors:stretch:limit"
|
#define CONFIG_STRETCH_LIMIT "plugin:dynamic-cursors:stretch:limit"
|
||||||
#define CONFIG_STRETCH_FUNCTION "plugin:dynamic-cursors:stretch:function"
|
#define CONFIG_STRETCH_FUNCTION "plugin:dynamic-cursors:stretch:function"
|
||||||
|
|
||||||
#define CONFIG_HW_DEBUG "plugin:dynamic-cursors:hw_debug"
|
|
||||||
|
|
||||||
inline HANDLE PHANDLE = nullptr;
|
inline HANDLE PHANDLE = nullptr;
|
||||||
|
|
|
@ -91,13 +91,13 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
||||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_SHAKE_THRESHOLD, Hyprlang::FLOAT{4});
|
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_SHAKE_THRESHOLD, Hyprlang::FLOAT{4});
|
||||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_SHAKE_FACTOR, Hyprlang::FLOAT{1.5});
|
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_SHAKE_FACTOR, Hyprlang::FLOAT{1.5});
|
||||||
|
|
||||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_FUNCTION, Hyprlang::STRING{"negative_quadratic"});
|
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_TILT_FUNCTION, Hyprlang::STRING{"negative_quadratic"});
|
||||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_MASS, Hyprlang::INT{5000});
|
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_TILT_LIMIT, Hyprlang::INT{5000});
|
||||||
|
|
||||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_STRETCH_FUNCTION, Hyprlang::STRING{"negative_quadratic"});
|
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_STRETCH_FUNCTION, Hyprlang::STRING{"negative_quadratic"});
|
||||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_STRETCH_LIMIT, Hyprlang::INT{3000});
|
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_STRETCH_LIMIT, Hyprlang::INT{3000});
|
||||||
|
|
||||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_LENGTH, Hyprlang::INT{20});
|
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_ROTATE_LENGTH, Hyprlang::INT{20});
|
||||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_ROTATE_OFFSET, Hyprlang::FLOAT{0});
|
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_ROTATE_OFFSET, Hyprlang::FLOAT{0});
|
||||||
|
|
||||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_HW_DEBUG, Hyprlang::INT{0});
|
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_HW_DEBUG, Hyprlang::INT{0});
|
||||||
|
|
|
@ -6,7 +6,7 @@ EModeUpdate CModeRotate::strategy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SModeResult CModeRotate::update(Vector2D pos) {
|
SModeResult CModeRotate::update(Vector2D pos) {
|
||||||
static auto* const* PLENGTH = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_LENGTH)->getDataStaticPtr();
|
static auto* const* PLENGTH = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_ROTATE_LENGTH)->getDataStaticPtr();
|
||||||
static auto* const* POFFSET = (Hyprlang::FLOAT* const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_ROTATE_OFFSET)->getDataStaticPtr();
|
static auto* const* POFFSET = (Hyprlang::FLOAT* const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_ROTATE_OFFSET)->getDataStaticPtr();
|
||||||
|
|
||||||
// translate to origin
|
// translate to origin
|
||||||
|
|
|
@ -8,8 +8,8 @@ EModeUpdate CModeTilt::strategy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
SModeResult CModeTilt::update(Vector2D pos) {
|
SModeResult CModeTilt::update(Vector2D pos) {
|
||||||
static auto const* PFUNCTION = (Hyprlang::STRING const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_FUNCTION)->getDataStaticPtr();
|
static auto const* PFUNCTION = (Hyprlang::STRING const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_TILT_FUNCTION)->getDataStaticPtr();
|
||||||
static auto* const* PMASS = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_MASS)->getDataStaticPtr();
|
static auto* const* PMASS = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_TILT_LIMIT)->getDataStaticPtr();
|
||||||
|
|
||||||
// create samples array
|
// create samples array
|
||||||
int max = g_pHyprRenderer->m_pMostHzMonitor->refreshRate / 10; // 100ms worth of history
|
int max = g_pHyprRenderer->m_pMostHzMonitor->refreshRate / 10; // 100ms worth of history
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue