A Rust implementation of EventGhost, a powerful automation tool for Windows. This project aims to modernize EventGhost while maintaining compatibility with existing plugins and configurations.
- Modern GTK4-based user interface
- Configuration persistence with JSON serialization
- Drag-and-drop support for configuration items
- Plugin system architecture
- Event handling system
- Logging system with filtering and search
- Main window with menu bar and toolbar
- Log window with real-time updates
- Configuration tree view
- Configuration dialogs for items:
- Plugins
- Folders
- Macros
- Events
- Actions
- JSON-based configuration storage
- Auto-save functionality
- Hierarchical configuration structure
- CRUD operations for all item types
- Drag-and-drop reordering
- Rust 1.70 or later
- GTK4 development libraries
- Windows 10 or later
- Install Rust using rustup
- Install GTK4 development libraries:
# Windows (using MSYS2) pacman -S mingw-w64-x86_64-gtk4 # Linux sudo apt install libgtk-4-dev
- Clone the repository:
git clone https://github.com/yourusername/EventGhost-Rust.git cd EventGhost-Rust
- Build the project:
# Build the binary application cargo build --bin test-gui --release # Running tests requires the testing feature flag cargo test --features testing
The project uses feature flags to control the build:
testing
: Enables testing utilities and mocks for unit testsproduction
: Used for production buildsplugin_hot_reload
: Enables hot reloading of plugins during development
- When building with
cdylib
crate type, you may encounter an "export ordinal too large" error due to the size of the project. To work around this, the main build uses onlyrlib
crate type. Thecdylib
type will only be enabled for releases in the future.
cargo run --bin test-gui --release
src/
├── core/ # Core functionality
├── eg/ # EventGhost-specific code
│ ├── classes/ # UI components
│ ├── config/ # Configuration handling
│ └── plugins/ # Plugin system
├── bin/ # Binary entry points
│ └── test-gui.rs # Main application entry point
└── resources/ # Application resources
- Follow Rust standard naming conventions
- Use meaningful commit messages following conventional commits
- Write tests for new functionality
- Document public APIs
- Keep code modular and maintainable
Run the test suite:
cargo test --features testing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to your branch
- Create a Pull Request
This project is licensed under the GPL-2.0 License - see the LICENSE file for details.
- Original EventGhost project and contributors
- GTK4 team for the excellent UI toolkit
- Rust community for the amazing ecosystem
EventGhost-Rust is currently in active development. The core architecture is in place, and we're actively implementing features to reach feature parity with the original EventGhost.
- Enhanced .egtree Configuration Handling: Improved handling of .egtree configuration files with base64 encoding/decoding support.
- Detailed Item Display in Configuration View: Items in the tree view now display more detailed information (e.g., file paths for plugins, script previews for actions).
- Autostart Folder: Added the Autostart folder to the configuration tree to better organize startup items.
We've updated several files to ensure compatibility with GTK4:
- Updated import paths in
src/eg/classes/tree_ctrl.rs
to use GTK4 components - Fixed ModifierType imports in
src/eg/classes/config_view.rs
to usegdk4::ModifierType
- Updated Rectangle imports in
src/eg/classes/log_ctrl.rs
to usegdk4::Rectangle
- Fixed RGBA imports in
src/eg/classes/dialog.rs
to usegdk4::RGBA
- Implemented MockPlugin and MockEvent directly in core modules for testing
These changes ensure that the application works correctly with GTK4 and avoids deprecation warnings.
There is an access violation occurring in some tests when run together, but individual tests run fine. This will require further investigation.
The original EventGhost is written in Python and has a rich feature set developed over many years. This Rust implementation aims to:
- Preserve core functionality: Event handling, plugin system, and macro execution
- Modernize the codebase: Use Rust's strong type system and modern UI technologies
- Improve performance: Take advantage of Rust's efficiency and safety
While we're making steady progress, there are still substantial gaps compared to the Python version:
- Plugin Ecosystem: The original has 100+ plugins for various devices and applications
- Python Compatibility: Legacy plugins require Python interoperability
- UI Features: Some advanced UI features are still being implemented
- Hardware Support: Many specialized device drivers need to be ported
Our roadmap includes:
- Complete the GTK4 migration for a modern UI experience
- Develop a Python compatibility layer for legacy plugins
- Implement the most commonly used plugins natively in Rust
- Add comprehensive testing and error handling
- Create better documentation for both users and developers
See TODO.md for detailed implementation plans.
Throughout this project, we've learned:
- GTK4 Transition: Moving from older GTK versions requires careful management of imports and APIs
- Rust for UI: Rust provides excellent safety guarantees but requires different patterns than traditional UI frameworks
- RefCell Management: Using
Rc<RefCell<T>>
in GTK applications requires careful borrowing strategies to avoid runtime panics - see our LESSONS_LEARNED.md document for detailed insights - Testing Complexity: UI-heavy applications need specialized testing approaches
- Balancing New vs Legacy: Finding the right balance between modern design and compatibility is challenging
We continue to document our learning in each major feature implementation.
- Updated import paths to use GTK4 components
- Fixed ModifierType imports to use
gdk4::ModifierType
- Updated Rectangle imports to use
gdk4::Rectangle
- Fixed RGBA imports to use
gdk4::RGBA
- Added explicit imports for dialog components like
AboutDialog
andLicense
- Fixed method parameter types for GTK4 dialog components
- Implemented proper type casting for window references
- Improved TreeView visibility with ScrolledWindow containers
- Fixed column sizing and expansion in TreeView components
- Enhanced layout configuration for properly resizable UI components
- Fixed menu component imports (
MenuItem
fromgio
instead ofgtk
) - Removed unnecessary
ModelExt
import that's included in prelude
- Fixed RefCell borrowing issues in UI components to prevent runtime panics
- Added Clone implementations to dialog structs and property grids
- Created consistent patterns for borrowing in GTK callbacks
- Improved error handling for mutable borrows in the configuration system
- Resolved trait bound issues for various widget methods