mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 08:03:21 +02:00
parent
fcb4c2b87b
commit
bbe4709926
4 changed files with 10 additions and 0 deletions
|
@ -34,6 +34,8 @@ This plugin is still very early in its development. There are also multiple thin
|
|||
- [ ] per-shape length and starting angle (if possible)
|
||||
- [X] cursor shake to find
|
||||
- [ ] overdue refactoring (wait for aquamarine merge)
|
||||
- [ ] inverted cursor?
|
||||
- [ ] hyprcursor magified shape
|
||||
|
||||
If anything here sounds interesting to you, don't hesitate to contribute.
|
||||
|
||||
|
@ -110,6 +112,10 @@ plugin:dynamic-cursors {
|
|||
# length in px of the simulated stick used to rotate the cursor
|
||||
# most realistic if this is your actual cursor size
|
||||
length = 20
|
||||
|
||||
# clockwise offset applied to the angle in degrees
|
||||
# this will apply to ALL shapes
|
||||
offset = 0.0
|
||||
}
|
||||
|
||||
# for mode = tilt
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#define CONFIG_SHAKE_EFFECTS "plugin:dynamic-cursors:shake:effects"
|
||||
#define CONFIG_SHAKE_IPC "plugin:dynamic-cursors:shake:ipc"
|
||||
#define CONFIG_LENGTH "plugin:dynamic-cursors:rotate:length"
|
||||
#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"
|
||||
|
||||
|
|
|
@ -120,6 +120,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
|
|||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_MASS, Hyprlang::INT{5000});
|
||||
|
||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_LENGTH, Hyprlang::INT{20});
|
||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_ROTATE_OFFSET, Hyprlang::FLOAT{0});
|
||||
|
||||
HyprlandAPI::addConfigValue(PHANDLE, CONFIG_HW_DEBUG, Hyprlang::INT{0});
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ EModeUpdate CModeRotate::strategy() {
|
|||
|
||||
double CModeRotate::update(Vector2D pos) {
|
||||
static auto* const* PLENGTH = (Hyprlang::INT* const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_LENGTH)->getDataStaticPtr();
|
||||
static auto* const* POFFSET = (Hyprlang::FLOAT* const*)HyprlandAPI::getConfigValue(PHANDLE, CONFIG_ROTATE_OFFSET)->getDataStaticPtr();
|
||||
|
||||
// translate to origin
|
||||
end.x -= pos.x;
|
||||
|
@ -25,6 +26,7 @@ double CModeRotate::update(Vector2D pos) {
|
|||
double angle = -std::atan(end.x / end.y);
|
||||
if (end.y > 0) angle += PI;
|
||||
angle += PI;
|
||||
angle += **POFFSET * ((2 * PI) / 360); // convert to radiants
|
||||
|
||||
// translate back
|
||||
end.x += pos.x;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue