sway-plugins

Crates.iosway-plugins
lib.rssway-plugins
version0.1.1
sourcesrc
created_at2024-05-12 07:42:05.681651
updated_at2024-05-17 04:43:03.160345
descriptionSome plugins for Sway
homepagehttps://github.com/atareao/swayplugins
repositoryhttps://github.com/atareao/swayplugins
max_upload_size
id1237281
size71,197
Lorenzo Carbonell (atareao)

documentation

README

project-logo

SWAY-PLUGINS

Empower Sway, Elevate Workspaces, Embrace Efficiency

license last-commit repo-top-language repo-language-count


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

  1. Clone the sway-plugins repository:
$ git clone https://github.com/atareao/sway-plugins
  1. Change to the project directory:
$ cd sway-plugins
  1. 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:

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/atareao/sway-plugins
    
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
    
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
    
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
    
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


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.

Return


Commit count: 14

cargo fmt