Code Monkey home page Code Monkey logo

lawn-mower's Introduction

lawn-mower 1.1

Overview

Lawn-mower finds all of the files in one or more directories and moves them to another one. At first I thought this would be a silly project, because it takes thought and care to organize a Desktop. Then I realized, I literally never click on Desktop icons. So I made a script that checks for items periodically and moves them to a specified folder. If I really care, I can always go find these items later.

After beginning the project, I realized that windows desktops are generated by several different filepaths. Mine comes from the local user desktop, the public user desktop, and the OneDrive user desktop. For that reason, the config JSON takes a list of files to look in, called SWEEPS.

At this time, DUSTBIN, the variable tracking where the files are placed, only takes one filepath and it should be a directory. If the directory in DUSTBIN doesn't exist, it will be created.

You can place the names of any files to be ignored in the IGNORES array. This should be file names, not file paths. Also, any items which would be overwritten are instead ignored.

Setup

After cloning the repository, change the name of example_config.json to config.json and open it.

{
    "SWEEPS": [
        "C:\\Users\\Public\\Desktop"
        ],
    "DUSTBIN": "C:\\Users\\Public\\Dustbin",
    "IGNORES": []
}

Place the filepaths to be checked in an array under SWEEPS. On Windows, remember to use double backslash between directories. Place the path to move files to in DUSTBIN. Add the filenames of any files you don't want moved in the IGNORES array.

You need the Python package schedule. This can be installed into a virtual environment on windows using the provided install.bat.

Running

Run with python.exe in a terminal to see the working log printed as the script executes.

On Windows, use the lawn-mower.bat to run in the installed venv with pythonw.exe. This will maintain the process in the background. You then need to use taskkill /pid -processId- /f to kill the process.

While the program is active, it will run about every 2 minutes.

Next Steps

  • I want to package the program in an .exe for portability.
  • I may expand the logic to organize files, not just move them all in a heap.
  • Add modified frequency

lawn-mower's People

Contributors

jonalfarlinga avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.