Skip to content

HSwift/m

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

m - File Fast Mover

A CLI tool for moving newly created files (like those in download directories) to the current directory or specified destinations.

Compilation

Prerequisites

  • Rust 1.70+ (for edition 2024 support)

Build

cargo build --release

The compiled binary will be located at target/release/m

Usage

Basic Usage

Run in any directory:

./m

The program will:

  1. Read configuration from ~/.config/m/m.json
  2. Scan configured directories for recently created files
  3. If files are found, display an interactive list for selection
  4. Ask if you want to rename the file (press Enter to keep current name)
  5. Move the selected file to the current directory

Using Destination Shortcuts

You can specify a destination shortcut from your configuration:

./m docs
./m pics
./m videos

This will move the selected file to the corresponding destination directory configured in destination.

Usage Example

? Select a file to move:  
> 14:43 12KB      document.docx
  14:41 3MB       hello.png
[Use arrow keys to navigate, press Enter to select]

After selecting a file:

? Rename file (press Enter to keep current name): document.docx
  • Press Enter to keep the original name
  • Or type a new name to rename the file

Finally:

Successfully moved 'document.docx' to /home/user/Documents/

Configuration

The configuration file is located at ~/.config/m/m.json and contains:

  • source_dir: Array of directory paths to monitor for recently created files
  • time_limit: File creation time limit in minutes
  • destination: (Optional) Map of destination shortcuts to directory paths

Default Configuration

A default configuration file will be created on first run:

{
  "source_dir": [
    "/home/user/Downloads/"
  ],
  "time_limit": 20,
  "destination": {}
}

Configuration Example

{
  "source_dir": [
    "/home/user/Downloads/",
    "/home/user/Desktop/",
    "/tmp/"
  ],
  "time_limit": 30,
  "destination": {
    "docs": "/home/user/Documents/",
    "pics": "/home/user/Pictures/",
    "videos": "/home/user/Videos/",
    "projects": "/home/user/Projects/"
  }
}

Destination Shortcuts

The destination field allows you to define shortcuts for frequently used directories. When you run ./m <shortcut>, the selected file will be moved to the corresponding directory instead of the current directory.

For example, with the configuration above:

  • ./m docs moves files to /home/user/Documents/
  • ./m pics moves files to /home/user/Pictures/
  • ./m videos moves files to /home/user/Videos/

About

File Fast Mover

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages