Skip to content

Latest commit

 

History

History
150 lines (116 loc) · 4.62 KB

README.md

File metadata and controls

150 lines (116 loc) · 4.62 KB

desktidy

Intelligent desktop file organization tool that automatically sorts and categorizes files on the macOS desktop into appropriate folders based on file type, age, and usage patterns.

Features

  • Automatic File Categorization: Sorts files into folders based on their types (images, documents, code, etc.)
  • Smart Organization Rules: Uses file age, access patterns, and importance to determine appropriate actions
  • DELETE Folder: Creates a special folder for temporary or low-value files awaiting review
  • Interactive Mode: Confirms before moving important files with detailed information
  • Scheduling: Supports automated cleanup on hourly, daily, or weekly schedules
  • Quiet Hours: Prevents scheduled runs during specified time periods
  • Undo Capability: Can reverse the most recent organization operation
  • Detailed Logging: Maintains comprehensive logs for all actions

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd desktidy
    
  2. Make the main script executable:

    chmod +x desktidy.py
    
  3. Optionally, create a symbolic link to make it accessible globally:

    ln -s $(pwd)/desktidy.py /usr/local/bin/desktidy
    

Usage

Basic Usage

Run the tool with default settings (interactive mode):

./desktidy.py

Command-line Options

usage: desktidy.py [-h] [--dry-run] [--non-interactive] [--undo] [--auto]
                   [--schedule {hourly,daily,weekly}] [--time TIME]
                   [--day {monday,tuesday,wednesday,thursday,friday,saturday,sunday}]
                   [--interval INTERVAL] [--unschedule] [--schedule-info]
                   [--quiet-hours {enable,disable}] [--quiet-start QUIET_START]
                   [--quiet-end QUIET_END]

Intelligent desktop file organization tool

options:
  -h, --help            show this help message and exit
  --dry-run             Run without actually moving any files (default: False)
  --non-interactive     Run without asking for confirmation for each file
                        (default: False)
  --undo                Undo the last organization operation (default: False)
  --auto                Run automatically (used by scheduler) (default: False)

Scheduling options:
  --schedule {hourly,daily,weekly}
                        Schedule automatic cleanup
  --time TIME           Time for scheduled cleanup (HH:MM format)
  --day {monday,tuesday,wednesday,thursday,friday,saturday,sunday}
                        Day for weekly scheduled cleanup
  --interval INTERVAL   Minutes between runs for hourly schedule
  --unschedule          Remove scheduled cleanup (default: False)
  --schedule-info       Show scheduled cleanup information (default: False)

Quiet hours options:
  --quiet-hours {enable,disable}
                        Enable or disable quiet hours
  --quiet-start QUIET_START
                        Start time for quiet hours (HH:MM format)
  --quiet-end QUIET_END
                        End time for quiet hours (HH:MM format)

Examples

  1. Run in dry-run mode (no actual changes):

    ./desktidy.py --dry-run
    
  2. Run in non-interactive mode:

    ./desktidy.py --non-interactive
    
  3. Undo the last organization:

    ./desktidy.py --undo
    
  4. Schedule daily cleanup at 3 AM:

    ./desktidy.py --schedule daily --time 03:00
    
  5. Schedule weekly cleanup on Sunday at 1 AM:

    ./desktidy.py --schedule weekly --day sunday --time 01:00
    
  6. Set quiet hours (9 AM to 6 PM):

    ./desktidy.py --quiet-hours enable --quiet-start 09:00 --quiet-end 18:00
    
  7. View current schedule:

    ./desktidy.py --schedule-info
    
  8. Remove scheduling:

    ./desktidy.py --unschedule
    

Default Organization Structure

The tool organizes files into the following folders on your desktop:

  • Images: Photos and graphics (.jpg, .png, .gif, etc.)
  • Documents: Text files and office documents (.pdf, .doc, .txt, etc.)
  • Code: Programming and markup files (.py, .js, .html, etc.)
  • Archives: Compressed files (.zip, .tar.gz, .rar, etc.)
  • Audio: Sound files (.mp3, .wav, .aac, etc.)
  • Video: Video files (.mp4, .mov, .avi, etc.)
  • Apps: Executable files (.app, .exe, .dmg, etc.)
  • Screenshots: macOS screenshot files
  • Miscellaneous: Files that don't fit other categories
  • DELETE: Temporary and low-value files for review

Logs and Configuration

All logs and configuration files are stored in the ~/.desktidy/ directory:

  • Logs: ~/.desktidy/logs/
  • History: ~/.desktidy/history/
  • Schedule Config: ~/.desktidy/schedule.json

License

MIT License