8 releases

new 0.1.1 Jan 20, 2025
0.1.0 Jan 19, 2025
0.0.6 Dec 3, 2024
0.0.3 Nov 14, 2024
0.0.1 Oct 29, 2024

#1213 in Command line utilities

MIT license

81KB
1.5K SLoC

wincent-rs

Overview

Wincent is a rust library for managing Windows quick access functionality, providing comprehensive control over your file system's quick access content.

Features

  • 🔍 Query Quick Access Contents
  • ➕ Add Items to Quick Access
  • 🗑️ Remove Specific Quick Access Entries
  • 🧹 Clear Quick Access Items
  • 👁️ Toggle Visibility of Quick Access Items

Installation

Add the following to your Cargo.toml:

[dependencies]
wincent = "*"

Quick Start

Querying Quick Access Contents

use wincent::{check_feasible, fix_feasible, get_quick_access_items, error::WincentError};

fn main() -> Result<(), WincentError> {
    // Check if quick access is feasible
    if !check_feasible()? {
        fix_feasible()?;
    }

    // List all current quick access items
    let quick_access_items = get_quick_access_items()?;
    for item in quick_access_items {
        println!("Quick Access item: {}", item);
    }

    Ok(())
}

Removing a Quick Access Entry

use wincent::{get_recent_files, remove_from_recent_files, error::WincentError};

fn main() -> Result<(), WincentError> {
    // Remove sensitive files from recent items
    let recent_files = get_recent_files()?;
    for item in recent_files {
        if item.contains("password") {
            remove_from_recent_files(&item)?;
        }
    }

    Ok(())
}

Toggling Visibility

use wincent::{is_recent_files_visiable, set_recent_files_visiable, error::WincentError};

fn main() -> Result<(), WincentError> {
    let is_visible = is_recent_files_visiable()?;
    println!("Recent files visibility: {}", is_visible);

    set_recent_files_visiable(!is_visible)?;
    println!("Visibility toggled");

    Ok(())
}

Error Handling

The library uses Rust's Result type for comprehensive error management, allowing precise handling of potential issues during quick access manipulation.

Compatibility

  • Supports Windows 10 and Windows 11
  • Requires Rust 1.60.0 or later

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b wincent/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add some amazing feature')
  4. Push to the branch (git push origin wincent/amazing-feature)
  5. Open a Pull Request

Development Setup

# Clone the repository
git clone https://github.com/Hellager/wincent-rs.git
cd wincent-rs

# Install development dependencies
cargo build
cargo test

Disclaimer

This library interacts with system-level Quick Access functionality. Always ensure you have appropriate permissions and create backups before making significant changes.

Support

If you encounter any issues or have questions, please file an issue on our GitHub repository.

Thanks

License

Distributed under the MIT License. See LICENSE for more information.

Author

Developed with 🦀 by @Hellager

Dependencies

~141MB
~2.5M SLoC