2 releases
0.1.1 | May 17, 2024 |
---|---|
0.1.0 | May 12, 2024 |
#422 in Command line utilities
36KB
596 lines
SWAY-PLUGINS
Empower Sway, Elevate Workspaces, Embrace Efficiency
Table of Contents
Overview
Sway-plugins is a versatile project that enhances the functionality of the Sway window manager through autonaming, autotiling, and autotransparency features. With a focus on transparency and seamless integration with command-line utilities, Sway-plugins creates a robust plugin ecosystem to improve user experience. These plugins enable dynamic workspace renaming, efficient window tiling, and dynamic window opacity adjustments, providing users with enhanced productivity and customization options within the Sway environment.
Features
Feature | Description | |
---|---|---|
⚙️ | Architecture | The project follows a modular architecture emphasizing dynamic configuration handling and event-driven scripts. It focuses on creating a robust plugin ecosystem for enhanced user experience within the Sway window manager. |
🔩 | Code Quality | The codebase exhibits well-structured and maintainable code with a focus on modularity. It follows Rust best practices and emphasizes readability and extensibility for plugin development. |
📄 | Documentation | The project includes detailed documentation embedded within the codebase, explaining the purpose and functionality of various components. However, external documentation could be enhanced to onboard new contributors and users efficiently. |
🔌 | Integrations | Key integrations include Cargo for dependency management and various Rust libraries like toml-rs, yaml-rust for configuration handling. These integrations enhance the project's functionality and interoperability. |
🧩 | Modularity | The codebase demonstrates high modularity with separate modules for configurations, plugins, and models. This design promotes code reusability and makes it easier to extend and customize plugin functionalities. |
🧪 | Testing | The project uses Rust's built-in testing framework for unit tests to ensure the reliability and correctness of the codebase. However, additional integration and end-to-end testing could further improve overall code quality. |
⚡️ | Performance | The codebase emphasizes efficiency in event processing and plugin lifecycle management. It aims to provide a smooth user experience within the Sway environment, focusing on speed and resource optimization. |
🛡️ | Security | Security measures include graceful error handling, configuration validation, and dynamic command execution to prevent vulnerabilities. However, further security audits and validation checks are recommended. |
📦 | Dependencies | Key dependencies include Cargo for package management, with dependencies like toml-rs and yaml-rust for configuration handling. These libraries enhance the project's capabilities and contribute to its functionality. |
Repository Structure
└── sway-plugins/
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── README.md
├── config.yml
└── src
├── main.rs
├── models
└── plugins
Modules
.
File | Summary |
---|---|
Cargo.toml | Defines plugin dependencies for Sway window manager to enhance functionality. Emphasizes transparency, autonaming, and autotiling features. Facilitates seamless integration with command-line utilities. Focuses on creating a robust plugin ecosystem for improved user experience. |
config.yml | Enables autonaming, autotiling, and autotransparency configurations in Sway window manager plugins. Custom icons for various apps are defined in the config.yml file. These settings enhance user experience and productivity within the Sway environment. |
src
File | Summary |
---|---|
main.rs | Executes event-driven scripts based on a single-instance model. Manages plugin lifecycle with dynamic configuration handling. Signals termination/interruption to gracefully end processes. Emphasizes modular plugin architecture and efficient event processing for the SwayPlugins repository. |
src.models
File | Summary |
---|---|
config.rs | Reads and parses YAML configuration file to struct. Contains autonaming, autotiling, and autotransparency settings. Handles errors gracefully. Influential in defining plugin behaviors within sway-plugins repository. |
mod.rs | Exposes configuration, parts, workspace, root, and runner modules for the sway-plugins repository. Facilitates access to critical components defining the architecture. Essential for configuring and managing the sway plugins effectively. |
parts.rs | Transforms string into structured parts using regex captures; enables conversion between Parts struct and string representation for easy manipulation and display. |
root.rs | Retrieves workspaces from a tree node recursively.-Instantiates a root node with connection details.-Finds a workspace by node reference. |
runner.rs | Connection`. Handles multiple commands or a single command, logging results and errors. Contributes to the parent repositorys plugin architecture to interact with the Sway window manager. |
workspace.rs | Defines a Workspace struct with methods to retrieve workspace details, like name, number, ID, and applications. It also includes functions to check for focused nodes and determine if a specific node exists within the workspace. |
src.plugins
File | Summary |
---|---|
autonaming.rs | Implements Autonaming plugin to dynamically rename workspaces based on app icons. Initiates, updates, and reverts workspace names. Accepts configuration for custom icon mappings and duplicate handling. Controlled by workspace events, ensuring accurate workspace labeling. |
autotiling.rs | Processes window events based on dimensions, executing split commands. Enables dynamic tiling in the Sway window manager. |
autotransparency.rs | Implements Autotransparency plugin for dynamic window opacity adjustments based on focus events. Utilizes configuration settings for enabling transparency and defining the opacity level. Executes specific commands for marking, unmarking, and adjusting window opacity. |
mod.rs | Enables integration of autonaming, autotiling, and autotransparency plugins. Exposes PluginTrait and Plugin for extensibility. Contributes to sway-plugins architectural flexibility and modularity. |
plugin.rs | Defines plugins handling events in Sway window manager config. Orchestrates plugin lifecycle methods and interactions based on configuration, enabling modularity and extensibility in the repositorys architecture. |
Getting Started
System Requirements:
- Rust:
version x.y.z
Installation
From source
- Clone the sway-plugins repository:
$ git clone https://github.com/atareao/sway-plugins
- Change to the project directory:
$ cd sway-plugins
- Install the dependencies:
$ cargo build
Usage
From source
Run sway-plugins using the command below:
$ cargo run
Tests
Run the test suite using the command below:
$ cargo test
Project Roadmap
-
► INSERT-TASK-1
-
► INSERT-TASK-2
-
► ...
Contributing
Contributions are welcome! Here are several ways you can contribute:
- Report Issues: Submit bugs found or log feature requests for the
sway-plugins
project. - Submit Pull Requests: Review open PRs, and submit your own PRs.
- Join the Discussions: Share your insights, provide feedback, or ask questions.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/atareao/sway-plugins
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to github: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
License
This project is protected under the SELECT-A-LICENSE License. For more details, refer to the LICENSE file.
Acknowledgments
- List any resources, contributors, inspiration, etc. here.
Dependencies
~15–27MB
~410K SLoC