diff --git a/README.md b/README.md index abd4718..2e984ed 100644 --- a/README.md +++ b/README.md @@ -654,7 +654,7 @@ Example 1: false - notify-send 'Hello World' "Swipe down, DEVICE_TYPE=$TOUCHEGG_DEVICE_TYPE" + notify-send 'Hello World' "Swipe down, DEVICE_TYPE=$TOUCHEGG_DEVICE_TYPE TOUCHEGG_GESTURE_ON=$TOUCHEGG_GESTURE_ON" begin diff --git a/src/actions/run-command.cpp b/src/actions/run-command.cpp index 86c4f8d..af9cd0c 100644 --- a/src/actions/run-command.cpp +++ b/src/actions/run-command.cpp @@ -22,6 +22,7 @@ #include "animations/animation-factory.h" void RunCommand::onGestureBegin(const Gesture &gesture) { + setenv("TOUCHEGG_GESTURE_ON", "begin", 1); RepeatedAction::onGestureBegin(gesture); if (!this->animate) { @@ -38,6 +39,16 @@ void RunCommand::onGestureBegin(const Gesture &gesture) { } } +void RunCommand::onGestureUpdate(const Gesture &gesture) { + setenv("TOUCHEGG_GESTURE_ON", "update", 1); + RepeatedAction::onGestureUpdate(gesture); +} + +void RunCommand::onGestureEnd(const Gesture &gesture) { + setenv("TOUCHEGG_GESTURE_ON", "end", 1); + RepeatedAction::onGestureEnd(gesture); +} + void RunCommand::executePrelude() { if (this->settings.count("command") == 1) { this->command = this->settings.at("command"); diff --git a/src/actions/run-command.h b/src/actions/run-command.h index 7c24035..fded290 100644 --- a/src/actions/run-command.h +++ b/src/actions/run-command.h @@ -29,6 +29,8 @@ class RunCommand : public RepeatedAction { public: using RepeatedAction::RepeatedAction; void onGestureBegin(const Gesture &gesture) override; + void onGestureUpdate(const Gesture &gesture) override; + void onGestureEnd(const Gesture &gesture) override; bool runOnSystemWindows() override { return true; } void executePrelude() override; void executeAction(const Gesture &gesture) override;